fpc/tests/test/trtti23.pp
svenbarth ca7c775e36 * fix for Mantis #38642: for enumerations with jumps Delphi behaves as follows:
- GetTypeKind returns tkEnumeration (FPC previously generated a compile error here)
  - GetTypeInfo on a generic parameters returns Nil for such types (FPC previously generated a compile error here)
  - GetTypeInfo otherwise generates a compile error (as before)

git-svn-id: trunk@49064 -
2021-03-27 09:35:07 +00:00

28 lines
386 B
ObjectPascal

{ %FAIl }
{ inside of generics TypeInfo() of types without type information (e.g. enums
with holes) that are not generic parameters throws a compile error }
program trtti23;
{$mode objfpc}
type
TEnum = (teOne = 1, teTwo);
generic TTest<T> = class
procedure Test;
end;
{ TTest }
procedure TTest.Test;
var
ti: Pointer;
begin
ti := TypeInfo(TEnum);
end;
begin
end.