pascalabcnet/TestSuite/generics30.pas
Бондарев Иван f2df27dd87 bug fix #2119
2019-10-03 14:40:05 +02:00

23 lines
397 B
ObjectPascal

type
TErr<T> = class;
TBase = abstract class
public static procedure p1<T>(temp: TErr<T>);
end;
TErr<T> = class(TBase) end;
static procedure TBase.p1<T>(temp: TErr<T>);
begin
var q: TErr<T> := new TErr<T>;
var a1: TBase := q;
var a2: TBase := q as TBase;
assert(a2 <> nil);
q := a1 as TErr<T>;
assert(q <> nil);
end;
begin
TBase.p1&<integer>(nil);
end.