* make stringconstn => open array of char a l1 conversion as it was earlier, resolves #10727

git-svn-id: trunk@10984 -
This commit is contained in:
florian 2008-05-17 18:18:51 +00:00
parent 52f81c97cf
commit e265393d7a
4 changed files with 35 additions and 5 deletions

1
.gitattributes vendored
View File

@ -8158,6 +8158,7 @@ tests/webtbs/tw1066b.pp svneol=native#text/plain
tests/webtbs/tw1068.pp svneol=native#text/plain
tests/webtbs/tw10681.pp svneol=native#text/plain
tests/webtbs/tw1071.pp svneol=native#text/plain
tests/webtbs/tw10727.pp svneol=native#text/plain
tests/webtbs/tw1073.pp svneol=native#text/plain
tests/webtbs/tw10736.pp svneol=native#text/plain
tests/webtbs/tw10753.pp svneol=native#text/plain

View File

@ -717,7 +717,12 @@ implementation
{ array -> open array }
if not(cdo_parameter in cdoptions) and
equal_defs(tarraydef(def_from).elementdef,tarraydef(def_to).elementdef) then
eq:=te_equal;
begin
if fromtreetype=stringconstn then
eq:=te_convert_l1
else
eq:=te_equal;
end;
end
else
{ to array of const }

View File

@ -2780,8 +2780,8 @@ implementation
LOC_CREFERENCE,
LOC_REFERENCE:
begin
reference_reset_base(href,cg.getaddressregister(list),objdef.vmt_offset);
cg.a_load_loc_reg(list,OS_ADDR,selfloc,href.base);
reference_reset_base(href,cg.getaddressregister(list),objdef.vmt_offset);
cg.a_load_loc_reg(list,OS_ADDR,selfloc,href.base);
end;
else
internalerror(200305057);
@ -2838,5 +2838,3 @@ implementation
end;
end.

26
tests/webtbs/tw10727.pp Normal file
View File

@ -0,0 +1,26 @@
{$ifdef fpc} {$mode delphi}{$endif}
Type
TStringBuilder = Class
function Insert(Index: Integer; const Value: string; Count: Integer = 1): TStringBuilder; overload;
function Insert(Index: Integer; const Value: array of Char): TStringBuilder; overload;
end;
function TStringBuilder.Insert(Index: Integer; const Value: array of Char): TStringBuilder;
begin
writeln('Called TStringBuilder.Insert(Index: Integer; const Value: array of Char): TStringBuilder;');
result:=nil;
end;
function TStringBuilder.Insert(Index: Integer; const Value: string; Count: Integer): TStringBuilder;
begin
writeln('Called TStringBuilder.Insert(Index: Integer; const Value: string; Count: Integer): TStringBuilder;');
result:=nil;
end;
var sb : TSTringBuilder;
begin
sb:=TStringBuilder.Create;
sb.Insert(0, '0 ');
sb.Free;
end.