Wrong priority for string for overloaded methods
Original Reporter info from Mantis: hnb
-
Reporter name: Maciej Izak
Original Reporter info from Mantis: hnb
- Reporter name: Maciej Izak
Description:
FPC prefers to call Create with untyped Data instead of version with string (also Delphi incompatible):
{$mode delphi}
type
TGuidHelper = record helper for TGUID
Class Function Create(const Data): TGUID; overload; static; inline;
Class Function Create(const S: string): TGUID; overload; static;
end;
class function TGuidHelper.Create(const Data): TGUID;
begin
writeln('A');
end;
class function TGuidHelper.Create(const S: string): TGUID;
begin
writeln('B');
end;
var
c: PChar;
g: TGUID;
begin
g.Create(utf8string(c)); // will print 'A'
g.Create(unicodestring(c)); // will print 'A'
g.Create(shortstring(c)); // will print 'A'
end.
Mantis conversion info:
- Mantis ID: 32179
- Version: 3.1.1
- Fixed in version: 3.3.1
- Fixed in revision: 40012 (#9bd931e9)