Martin Frb via fpc-devel <[email protected]> schrieb am So., 19. Okt. 2025, 17:50:
> On 19/10/2025 17:33, Hairy Pixels via fpc-devel wrote: > > On Oct 19, 2025 at 10:27:50 PM, Martin Frb via fpc-devel < > [email protected]> wrote: > >> Given an non-constrained param, then (in code) any member is assumed to >> be ok. >> But in declarations, members of the param can only be used if the >> compiler knows them. >> >> generic TGenA<T1,T2> = class >> X: T1; >> Y: T2.unknown; >> end; >> >> What reason may there be to reject the line for Y? >> > > I agree the compiler can not know that T2.unknown is a valid member before > specializing so it should be valid syntax. > > I think it's just a limitation in the parser. Ideally some subset of > typeless syntax should be allowed during the initial parse and only only > validated once the the type is specialized. > > > > Well, yes, it may be unimplemented in the parser... And maybe that is all > of it. > That's precisely it, nothing more, nothing less. These corner cases are fixed on a case-by-case base, cause the locations where a fix needs to happen are easier found that way than trying to understand and fix the whole parser. So if you want to see this fixed, then please report a bug. Regards, Sven
_______________________________________________ fpc-devel maillist - [email protected] https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
