fpc/tests/test/tmshlp8.pp
2019-05-10 14:04:45 +00:00

37 lines
514 B
ObjectPascal

{ %NORUN }
{$mode objfpc}
{$modeswitch typehelpers}
{$modeswitch multihelpers}
program tmshlp8;
uses
umshlp1;
type
TClassHelper = class helper for TObject
procedure DoThis;
end;
TStringHelper = type helper for String
function Length: integer;
end;
procedure TClassHelper.DoThis;
begin
DoThisExt;
end;
function TStringHelper.Length: integer;
begin
result := LengthExt;
end;
var
obj: TObject;
str: string;
begin
obj := TObject.Create;
obj.DoThis;
writeln(str.Length + str.LengthTimesTwo);
end.