pascalabcnet/TestSuite/extSelf.pas
Mikhalkovich Stanislav 32616a7269 fix #2180
2020-06-26 14:07:44 +03:00

22 lines
281 B
ObjectPascal

// #2180
type
t1 = class end;
function f1(self: t1; x: integer): integer; extensionmethod;
begin
Result := x * x;
end;
type
t2 = class(t1)
procedure test;
begin
Assert(f1(4)=16);
Assert(Self.f1(4)=16);
end;
end;
begin
t2.Create.test;
end.