fpc/tests/webtbf/tw9551.pp
Jonas Maebe 40247d2d87 * give an error when the typeinfo() function is called for an enumeration
whose base is not 0, or that has jumps in its value range (manits #9551)

git-svn-id: trunk@12960 -
2009-03-22 20:54:49 +00:00

24 lines
352 B
ObjectPascal

{ %fail }
uses
TypInfo,sysutils;
const
csMyConstValueA = 10;
csMyConstValueB = 20;
csMyConstValueC = 30;
type
TMyEnum = (meValueA = csMyConstValueA,
meValueB = csMyConstValueB,
meValueC = csMyConstValueC);
procedure Test;
begin
writeln(GetEnumName(TypeInfo(TMyEnum), Ord(meValueB)));
end;
begin
Test;
end.