From dfc23da06c463ec6924d52506e42cbd52ab2fd8a Mon Sep 17 00:00:00 2001 From: svenbarth Date: Thu, 4 May 2017 21:40:37 +0000 Subject: [PATCH] * tassignmentnode.pass_typecheck: also allow "dynarray := []" in addition to "dynarray := nil" git-svn-id: trunk@36098 - --- compiler/nld.pas | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/compiler/nld.pas b/compiler/nld.pas index 2140b4cfa9..5f3e8bc250 100644 --- a/compiler/nld.pas +++ b/compiler/nld.pas @@ -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 }