Forbidden word - field name "hash" with "with" keyword and generics usage.
Original Reporter info from Mantis: hnb
-
Reporter name: Maciej Izak
Original Reporter info from Mantis: hnb
- Reporter name: Maciej Izak
Description:
One of strangest error I have ever seen:
{$MODE DELPHI}
type
TA<T> = class
F: T;
end;
TB<T> = class
type
TC = record
hash: array[boolean] of T;
end;
var
A: TA<TC>;
procedure Foo;
end;
{ TB&LtPos;T> }
procedure TB<T>.Foo;
begin
with A.F do
if hash[false] = 0 then // Error: Illegal qualifier
// for any field name different than hash (in struct TC) all is ok... very strange error.
// if A.F.hash[false] = 0 then // <- ok
end;
Mantis conversion info:
- Mantis ID: 25597
- Version: 2.7.1