Basically it looks like multi helpers don’t actually work with overloaded 
methods and simply choses the last helper declared. Should I fix this? Seems 
unlikely we would not notice this before but maybe we did.

{$modeswitch typehelpers}
{$modeswitch multihelpers}

type
  TMyHelper1 = type helper for integer
    procedure DoThis(f: integer);
  end;
  TMyHelper2 = type helper for integer
    procedure DoThis(f: string);
  end;

procedure TMyHelper1.DoThis(f: integer);
begin
  writeln(self, ' => ', f);
end;

procedure TMyHelper2.DoThis(f: string);
begin
  writeln(self, ' => ', f);
end;

var
  i: integer = 0;
begin
  i.DoThis(0);  // Got "ShortInt", expected “ShortString"

Regards,
        Ryan Joseph

_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply via email to