[fpc-pascal] bug or feature?

Jonas Maebe jonas at freepascal.org
Sat Feb 12 17:58:27 CET 2022


On 12/02/2022 17:47, Michael Van Canneyt via fpc-pascal wrote:
> On Sat, 12 Feb 2022, Jonas Maebe via fpc-pascal wrote:
> 
>> On 12/02/2022 17:36, Michael Van Canneyt via fpc-pascal wrote:
>>> PS. Just tested, the compiler accepts both... Amazing, I never 
>>> thought this
>>> would be possible. I'd better update the docs :-)
>>
>> I wouldn't consider this to be working by design, but rather because 
>> of implementation limitations.
> 
> 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...


Jonas


More information about the fpc-pascal mailing list