Re: [fpc-pascal] Inline scoped enums

2018-04-08 Thread Mattias Gaertner
On Sun, 8 Apr 2018 09:22:51 +0200 Mattias Gaertner wrote: > On Sat, 7 Apr 2018 08:52:43 +0200 > Mattias Gaertner wrote: > > > On Fri, 6 Apr 2018 21:38:59 +0300 > > Роман via fpc-pascal wrote: > > > > > How can this code > > > {$scopedenums on} > > > type > > > Bar = set of (A, B, C); > >

Re: [fpc-pascal] Inline scoped enums

2018-04-08 Thread Mattias Gaertner
On Sat, 7 Apr 2018 08:52:43 +0200 Mattias Gaertner wrote: > On Fri, 6 Apr 2018 21:38:59 +0300 > Роман via fpc-pascal wrote: > > > How can this code > > {$scopedenums on} > > type > > Bar = set of (A, B, C); > > refer to A, B, C? > > Bar.A I correct myself: Bar.A is wrong. A is right. I

Re: [fpc-pascal] Inline scoped enums

2018-04-07 Thread Alexander Grotewohl
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 pa

Re: [fpc-pascal] Inline scoped enums

2018-04-07 Thread Роман via fpc-pascal
>> 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... ___

Re: [fpc-pascal] Inline scoped enums

2018-04-06 Thread Mattias Gaertner
On Fri, 6 Apr 2018 21:38:59 +0300 Роман via fpc-pascal wrote: > How can this code > {$scopedenums on} > type > Bar = set of (A, B, C); > refer to A, B, C? Bar.A Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.fre