[fpc-pascal] Inline scoped enums

Mattias Gaertner nc-gaertnma at netcologne.de
Sun Apr 8 09:54:42 CEST 2018


On Sun, 8 Apr 2018 09:22:51 +0200
Mattias Gaertner <nc-gaertnma at netcologne.de> wrote:

> On Sat, 7 Apr 2018 08:52:43 +0200
> Mattias Gaertner <nc-gaertnma at netcologne.de> wrote:
> 
> > On Fri, 6 Apr 2018 21:38:59 +0300
> > Роман via fpc-pascal <fpc-pascal at lists.freepascal.org> 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.
> 
> It's a bug in FPC.

It's also buggy in Delphi. As a nested type in a class you cannot
access A, neither with scopedenums of or on:

type
  TC = class
  public
    type TBar = set of (A, B, C);
  end;

Neither A, nor TBar.A, nor TC.TBar.A works in Delphi 10.2.

Mattias


Mattias



More information about the fpc-pascal mailing list