[fpc-pascal] Delphi generics bug?

Sven Barth pascaldragon at googlemail.com
Tue Jan 14 14:04:21 CET 2020


Ryan Joseph via fpc-pascal <fpc-pascal at lists.freepascal.org> schrieb am
Di., 14. Jan. 2020, 11:26:

> Is this a bug or intended behavior? I would think there should a type
> mismatch.
>
> {$mode delphi}
> program test;
>
> type
>   TFooA = class
>   end;
>
> type
>   TFooB = class
>   end;
>
> type
>   TList<T: TFooA> = class
>     procedure Foo;
>   end;
>
> procedure TList<T: TFooB>.Foo;
> begin
> end;
>
> begin
> end.
>

It's a bug because constraints should not be allowed in definitions, only
in declarations.

Regards,
Sven

>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20200114/b6c64811/attachment.html>


More information about the fpc-pascal mailing list