<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<div class="moz-cite-prefix">On 19/10/2025 17:33, Hairy Pixels via
fpc-devel wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CAGsUGtkJw7tH=jFB8sGo6Ck+R-j59e0+S4CQB2FC6KczS3uFQg@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<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"
moz-do-not-send="true" class="moz-txt-link-freetext">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>
<br>
Maybe historically it would have been a complex task to add. Yet,
currently it would seem to be that the parser just needs to skip any
amount of "dot identifier"?<br>
<br>
I though, if it may be some internal representation (nodes)
generated by the parser, that must later (at specialization) match.
But then I can have the base class<br>
<br>
{advanced records}<br>
TClassA = class<br>
public type record <br>
public type TUnknown: record end; <br>
end;<br>
end;<br>
<br>
and replace it by<br>
TClassA = class<br>
public type class<br>
public type TUnknown: byte; <br>
end;<br>
end;<br>
<br>
which surely generates something different?<br>
<br>
But then, of course I don't know the compiler internals...<br>
So hence I am asking...
</body>
</html>