Operator is not overloaded: "LongInt" shl "<undefined type>" for generic field.
Original Reporter info from Mantis: hnb
-
Reporter name: Maciej Izak
Original Reporter info from Mantis: hnb
- Reporter name: Maciej Izak
Description:
Strange behavior of the compiler. Sometimes passing operators (and, not), sometimes not (like shl/shr).
---program---
{$MODE DELPHI}
type
TA<T> = class
private
F1, F2: T;
procedure Foo;
end;
procedure TA<T>.Foo;
var
b: Integer;
begin
b := (b and F1) shr F2; // pass
b := (b and not F1) or (b shl F2); // Error: Operator is not overloaded: "LongInt" shl "<undefined type>"
end;
Mantis conversion info:
- Mantis ID: 25604
- Build: 26466
- Version: 2.7.1
- Fixed in version: 3.0.0
- Fixed in revision: 27535 (#e85075de)