Hello,In this samples, Test3 raises and error, like FPC does not see R is a record. Is this a bug?Code: Pascal [Select][+][-]program Project1; {$mode delphi} type TTest1 = record I: Integer; end; procedure Test1<T>(var V: T); begin with V do WriteLn(I); end; type TTest2<T> = record I: T; end; procedure Test2<T>(var V: T); begin with V do WriteLn(I); end; type TTest3Record<T> = record I: T; end; TTest3<T> = record R: TTest3Record<T>; end; procedure Test3<T>(var V: T); begin with V.R do //Error: Expression type must be class or record type, got <erroneous type> WriteLn(I); end; procedure Test3Direct<T>(var V: T); begin WriteLn(V.R.I); end; var V1: TTest1;type T2 = TTest2<Integer>;var V2: T2;type T3 = TTest3<Integer>;var V3: T3;begin Test1<TTest1>(V1); Test2<T2>(V2); Test3<T3>(V3); //Error Test3Direct<T3>(V3);end.
In this samples, Test3 raises and error, like FPC does not see R is a record. Is this a bug?
Have you tested this with recent Delphi ?
Reported as #40099.