* tassignmentnode.pass_typecheck: also allow "dynarray := []" in addition to "dynarray := nil"

git-svn-id: trunk@36098 -
This commit is contained in:
svenbarth 2017-05-04 21:40:37 +00:00
parent c6f19b9888
commit dfc23da06c

View File

@ -626,9 +626,16 @@ implementation
converted node (that array is 2^31 or 2^63 bytes large) }
exit;
{ assigning nil to a dynamic array clears the array }
{ assigning nil or [] to a dynamic array clears the array }
if is_dynamic_array(left.resultdef) and
(right.nodetype=niln) then
(
(right.nodetype=niln) or
(
(right.nodetype=arrayconstructorn) and
(right.resultdef.typ=arraydef) and
(tarraydef(right.resultdef).elementdef=voidtype)
)
) then
begin
{ remove property flag to avoid errors, see comments for }
{ tf_winlikewidestring assignments below }