program Fjf644;

type
  poo = ^oo;
  oo = object
    procedure m (const s: String); virtual;
  end;

var
  Called: Integer = 0;

procedure oo.m;
begin
  if Called = 1 then
    WriteLn (s)
  else
    WriteLn ('failed ', Called)
end;

function Foo = r: poo;
begin
  Inc (Called);
  New (r)
end;

begin
  foo^.m ('OK')
end.
