fpc/tests/test/tgeneric54.pp
svenbarth 66b667cc18 Added some tests for:
- multiple symbols with a similar name
- hint directives
- inline specializations

git-svn-id: branches/svenbarth/generics@17542 -
2011-05-23 19:47:09 +00:00

41 lines
617 B
ObjectPascal

{ this tests that type checks for inline specialized types work }
program tgeneric53;
{$ifdef fpc}
{$mode delphi}
{$endif}
{$apptype console}
type
TTest = class
function Test: Integer;
end;
TTestGen<T> = class(TTest)
function Test: Integer;
end;
function TTest.Test: Integer;
begin
Result := 1;
end;
function TTestGen<T>.Test: Integer;
begin
Result := 2;
end;
var
t: TTest;
begin
t := TTestGen<Integer>.Create;
if t is TTestGen<Integer> then
Writeln('t is a TTestGen<Integer>')
else begin
Writeln('t is not a TTestGen<Integer>');
Halt(1);
end;
Writeln('ok');
end.