mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-07 14:27:59 +02:00
* 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:
parent
663040a666
commit
44bfa98a30
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -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
|
||||
|
@ -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
18
tests/webtbs/tw35955.pp
Normal 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.
|
Loading…
Reference in New Issue
Block a user