fpc/tests/webtbs/tw11139.pp
Jonas Maebe 76e23fc54e * fixed internalerror when having to choose between different
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 -
2008-04-13 10:21:26 +00:00

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.