generics report division by zero on value dependent on specialization
Original Reporter info from Mantis: Martin @martin_frb
-
Reporter name: Martin Friebe
Original Reporter info from Mantis: Martin @martin_frb
- Reporter name: Martin Friebe
Description:
Compile the below.
If the commented line is uncommented it will give division by zero
Additional information:
program Project1;
type
generic TFoo<T> = class
const
Size = SizeOf(T);
public
function X: Integer;
end;
{ TFoo }
function TFoo.X: Integer;
begin
Result := 100 div SizeOf(T);
//Result := 100 div Size;
end;
begin
end.
Mantis conversion info:
- Mantis ID: 28058
- OS: win
- OS Build: vista
- Build: 30815
- Platform: w32
- Version: 3.1.1
- Fixed in version: 3.1.1
- Fixed in revision: 31262 (#9a55e8fa)