Am 12.12.2014 18:44 schrieb "silvioprog" <silviop...@gmail.com>:
>
> Hello,
>
> I need to restrict a generic type to accept specialization only of enum
types. In Delphi, I can do that using "T: record", but, when I try to use
it in FPC (even using mode delphi), I got:
>
> project1.lpr(16,42) Error: Record type expected
>
> Small project to reproduce the error in attachment.
>
> Is this a normal behavior of the compiler, or is my code a erroneous
approach?

Currently it is normal behavior of the compiler (because back then I didn't
realize that in that context "record" means basically "non-nullable") and
yes, there is already a bug report about it (just look through the
not-resolved and not-closed bug reports with tag "generics"). I'm still
thinking about how to name this better for non-Delphi modes...

Regards,
Sven
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to