[fpc-pascal] bug or feature?

Mattias Gaertner nc-gaertnma at netcologne.de
Sat Feb 12 21:46:10 CET 2022


On Sat, 12 Feb 2022 17:58:27 +0100
Jonas Maebe via fpc-pascal <fpc-pascal at lists.freepascal.org> wrote:

>[...]
> >> I wouldn't consider this to be working by design, but rather
> >> because of implementation limitations.  

+1
pas2js complained. That's how I found out. Someone renamed a class,
added an alias for compatibility, forgot to rename the
implementation, and fpc did not complain.

 
> > Why do you consider it a limitation ?
> > 
> > Because the compiler currently has no way to distinguish the types
> > when resolving the
> > name "T" (as used in my example)?  
> 
> Indeed.
> 
> > Then it is a strange coincidence that Delphi has it too :-)  
> 
> The simplest way to implement alias types is to just have them refer
> to the original type...

Actually pas2js did an even simpler approach here: Look up the
identifier without resolving the original type ;)

Mattias


More information about the fpc-pascal mailing list