Ryan Joseph via fpc-pascal <fpc-pascal@lists.freepascal.org> schrieb am
Mo., 4. Mai 2020, 18:48:

> Should generics accept empty sets as constants? I think they should and
> this is a bug but I wanted to ask first.
>
> ========================
>
> {$mode objfpc}
>
> program test;
>
> type
>   TItem = (A, B, C);
>   TItems = set of TItem;
>   generic GType<const T: TItems> = class
>   end;
>
> const
>   TOtherItems = [];   // no problems here
>
> type
>   // error: Incompatible types: got "Empty Set" expected "TItems"
>   TType = specialize GType<[]>;
>
> begin
> end.
>

Yes, they should indeed.

Regards,
Sven

>
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to