fpc/tests/test/tenum4.pp
paul 1b614b526a compiler:
- add own symbol table for enumeration to store enumeration elements
  - reimplement enumeration member traverse using symbol table instead of firstenum/nextenum - that members are removed
  - implement TEnum.Element access syntax - element is searched in the enumeration symtable in this case instead of global/local symtables
  - implement {$SCOPEDENUM ON/OFF} local switch
  + tests

git-svn-id: trunk@15051 -
2010-03-25 05:46:53 +00:00

18 lines
400 B
ObjectPascal

{ %fail}
{ %norun}
// test checks that enumeration memebers are not present in the global/local symtables
// if enumeration is defined with scopedenums directive
program tenum4;
type
{$SCOPEDENUMS ON}
TEnum1 = (first, second, third);
{$SCOPEDENUMS OFF}
TEnum2 = (zero, first, second, third);
var
En1: TEnum1;
begin
// this is not possible since first belongs to TEnum2
En1 := first;
end.