Merged revisions 983 via svnmerge from

/trunk

git-svn-id: branches/fixes_2_0@1012 -
This commit is contained in:
peter 2005-09-01 06:33:32 +00:00
parent 7d52f0d3cc
commit b639762949
3 changed files with 46 additions and 17 deletions

1
.gitattributes vendored
View File

@ -6007,6 +6007,7 @@ tests/webtbs/tw4240.pp svneol=native#text/plain
tests/webtbs/tw4247.pp svneol=native#text/plain
tests/webtbs/tw4253.pp svneol=native#text/plain
tests/webtbs/tw4260.pp svneol=native#text/plain
tests/webtbs/tw4272.pp svneol=native#text/plain
tests/webtbs/tw4277.pp svneol=native#text/plain
tests/webtbs/tw4294.pp svneol=native#text/plain
tests/webtbs/tw4308.pp svneol=native#text/plain

View File

@ -304,23 +304,35 @@ implementation
else
begin
doconv:=tc_string_2_string;
if tstringdef(def_from).string_typ=st_widestring then
begin
{ Prefer conversions to shortstring over other
conversions. This is compatible with Delphi (PFV) }
if tstringdef(def_to).string_typ=st_shortstring then
eq:=te_convert_l3
else
eq:=te_convert_l2;
end
else
{ Prefer shortstrings of different length or conversions
from shortstring to ansistring }
if (tstringdef(def_from).string_typ=st_shortstring) and
(tstringdef(def_to).string_typ in [st_shortstring,st_ansistring]) then
eq:=te_convert_l1
else
eq:=te_convert_l2;
case tstringdef(def_from).string_typ of
st_widestring :
begin
{ Prefer conversions to ansistring }
if tstringdef(def_to).string_typ=st_ansistring then
eq:=te_convert_l2
else
eq:=te_convert_l3;
end;
st_shortstring :
begin
{ Prefer shortstrings of different length or conversions
from shortstring to ansistring }
if (tstringdef(def_to).string_typ=st_shortstring) then
eq:=te_convert_l1
else if tstringdef(def_to).string_typ=st_ansistring then
eq:=te_convert_l2
else
eq:=te_convert_l3;
end;
st_ansistring :
begin
{ Prefer conversion to widestrings }
if (tstringdef(def_to).string_typ=st_widestring) then
eq:=te_convert_l2
else
eq:=te_convert_l3;
end;
end;
end;
end;
orddef :

16
tests/webtbs/tw4272.pp Executable file
View File

@ -0,0 +1,16 @@
procedure go(const w: widestring);overload;
begin
writeln('wide: ',w);
end;
procedure go(const w: shortstring);overload;
begin
writeln('short: ',w);
end;
var
s: ansistring;
begin
s:='test';
go(s); //-->compiler can not determine whitch overloaded function to call
end.