[fpc-devel] Question about generics / what is checked, and what not -- and why?
Martin Frb
lazarus at mfriebe.de
Sun Oct 19 18:10:27 CEST 2025
On 19/10/2025 18:02, Hairy Pixels via fpc-devel wrote:
> On Oct 19, 2025 at 10:50:42 PM, Martin Frb via fpc-devel
> <fpc-devel at lists.freepascal.org> wrote:
>> Well, yes, it may be unimplemented in the parser... And maybe that is
>> all of it.
>>
>> 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"?
>
> Ideally the parser catches syntax errors before specialization.
Yes, but as you can see from my example, even if a constrained type was
checked, the sub-class that is given to specialization may contain
something different. And with nested declarations, that can even mean
that a member that is accessible via the base class, does no longer
exist in the subclass, i.e the nested type from the base class is
hidden, and the "reintroduced" type does not have the same tree.
Originally I thought, well ok, it allows better checks. But then I
discovered, that this isn't the case.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20251019/1ea11863/attachment.htm>
More information about the fpc-devel
mailing list