<div dir="auto"><div><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">Martin Frb via fpc-devel <<a href="mailto:fpc-devel@lists.freepascal.org">fpc-devel@lists.freepascal.org</a>> schrieb am So., 19. Okt. 2025, 17:50:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><u></u>
<div>
<div>On 19/10/2025 17:33, Hairy Pixels via
fpc-devel wrote:<br>
</div>
<blockquote type="cite">
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Oct 19, 2025 at
10:27:50 PM, Martin Frb via fpc-devel <<a href="mailto:fpc-devel@lists.freepascal.org" target="_blank" rel="noreferrer">fpc-devel@lists.freepascal.org</a>>
wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" type="cite">
<div>Given an non-constrained param, then (in code) any member
is assumed to <br>
be ok.<br>
But in declarations, members of the param can only be used
if the <br>
compiler knows them.<br>
<br>
generic TGenA<T1,T2> = class<br>
X: T1;<br>
Y: T2.unknown;<br>
end;<br>
<br>
What reason may there be to reject the line for Y?<br>
</div>
</blockquote>
</div>
<br>
<div dir="ltr"> I agree the compiler can not know that T2.unknown
is a valid member before specializing so it should be valid
syntax.</div>
<div dir="ltr"><br>
</div>
<div dir="ltr">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.</div>
</blockquote>
<br>
<br>
Well, yes, it may be unimplemented in the parser... And maybe that
is all of it. <br></div></blockquote></div></div><div dir="auto"><br></div><div dir="auto">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.</div><div dir="auto"><br></div><div dir="auto">So if you want to see this fixed, then please report a bug.</div><div dir="auto"><br></div><div dir="auto">Regards, </div><div dir="auto">Sven </div></div>