mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2026-01-06 20:35:30 +01:00
overloads in case there is only one variant parameter and
one of the candidates has more hidden parameters than the
other at the start (e.g. function(para):char and
function(para):shortstring, depending on in which order the
hidden shortstring result and para are processed, mantis
#11139)
git-svn-id: trunk@10643 -
29 lines
412 B
ObjectPascal
29 lines
412 B
ObjectPascal
function f(c: char): char; overload;
|
|
begin
|
|
halt(1);
|
|
end;
|
|
|
|
function f(const s: shortstring): shortstring; overload;
|
|
begin
|
|
f:=lowercase(s);
|
|
end;
|
|
|
|
function f(const a: ansistring): ansistring; overload;
|
|
begin
|
|
halt(3);
|
|
end;
|
|
|
|
Procedure DoIt;
|
|
var avar:variant;
|
|
txt:String;
|
|
Begin
|
|
avar:='Hello';
|
|
txt:=f(avar);//this line causes the compilation error
|
|
if (txt<>'hello') then
|
|
halt(4);
|
|
end;
|
|
|
|
begin
|
|
doit;
|
|
end.
|