[fpc-pascal] Inline scoped enums

Alexander Grotewohl alex at dcclost.com
Sun Apr 8 04:51:50 CEST 2018


indeed. there are other type declarations where 'set of' is valid, so 
maybe it inadvertently piggybacks on those

to correct the code.. something like:

{$scopedenums on}
type
   bar = (a, b, c);
var
   foo: set of bar;
begin
   foo:=[bar.a, bar.c];
   if bar.a in foo then
     writeln('yay obscure pascal features! :)');
end.

On 4/7/2018 9:33 PM, Роман via fpc-pascal wrote:
> >> How can this code
> >> {$scopedenums on}
> >> type
> >>     Bar = set of (A, B, C);
> >> refer to A, B, C?
> > Bar.A
> >
> Actually Bar.A won't work, notice the "set of".
> Same problem with var x: (a, b, c).
> I wonder could they make such code to not compile at all...
> _______________________________________________
> fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org
> http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal



More information about the fpc-pascal mailing list