* fix for Mantis #35955: when the element of an array constructer requires an operator for conversion we don't let the caller of compare_defs_ext know that, instead we simply say that some conversion is required and let the typecheck handler deal with the element wise conversion

+ added test

git-svn-id: trunk@42700 -
This commit is contained in:
svenbarth 2019-08-15 14:33:00 +00:00
parent 663040a666
commit 44bfa98a30
3 changed files with 24 additions and 0 deletions

1
.gitattributes vendored
View File

@ -17787,6 +17787,7 @@ tests/webtbs/tw35937.pp svneol=native#text/plain
tests/webtbs/tw3594.pp svneol=native#text/plain
tests/webtbs/tw3595.pp svneol=native#text/plain
tests/webtbs/tw35953.pp svneol=native#text/pascal
tests/webtbs/tw35955.pp svneol=native#text/pascal
tests/webtbs/tw35965.pp svneol=native#text/pascal
tests/webtbs/tw3612.pp svneol=native#text/plain
tests/webtbs/tw3617.pp svneol=native#text/plain

View File

@ -1027,6 +1027,11 @@ implementation
end
else if subeq>te_convert_l6 then
eq:=pred(subeq)
else if subeq=te_convert_operator then
{ the operater needs to be applied by element, so we tell
the caller that it's some unpreffered conversion and let
it handle the per-element stuff }
eq:=te_convert_l6
else
eq:=subeq;
doconv:=tc_arrayconstructor_2_dynarray;

18
tests/webtbs/tw35955.pp Normal file
View File

@ -0,0 +1,18 @@
{ %NORUN }
program tw35955;
{$mode delphi}
type
TVariantArray = array of Variant;
var
S: string;
A: TVariantArray;
begin
S := 'xyz';
A := [S]; // << project1.lpr(13,8) Error: Compilation raised exception internally
Writeln(A[0]);
Readln;
end.