[fpc-devel] Enum values and scope

Martin lazarus at mfriebe.de
Wed Nov 6 15:06:48 CET 2013


The below compiles. (2.6.2)

It shows that the value identifier of an enum, can be reached via a lot 
of different pathes.

Just want to be sure they are all intentional?


unit Unit1;
{$mode objfpc}{$H+}
interface
uses  Classes, SysUtils;

type  TEnum = (e1,e2,e3);
var   en1: TEnum;

implementation
procedure Foo;
begin
   en1 := Unit1.e1;
   en1 := TEnum.e1;
   en1 := Unit1.TEnum.e1;
   en1 := en1.e1;
   en1 := Unit1.en1.e1;
end;

end.




More information about the fpc-devel mailing list