diff --git a/compiler/nld.pas b/compiler/nld.pas index 1b89aa6ced..2243b9e010 100644 --- a/compiler/nld.pas +++ b/compiler/nld.pas @@ -722,7 +722,11 @@ implementation { assignments to formaldefs and open arrays aren't allowed } if is_open_array(left.resultdef) then - CGMessage(type_e_assignment_not_allowed) + begin + CGMessage(type_e_assignment_not_allowed); + result:=cerrornode.create; + exit; + end else if (left.resultdef.typ=formaldef) then if not(target_info.system in systems_managed_vm) then CGMessage(type_e_assignment_not_allowed) diff --git a/tests/webtbf/tw40662.pp b/tests/webtbf/tw40662.pp new file mode 100644 index 0000000000..dc8e87bccd --- /dev/null +++ b/tests/webtbf/tw40662.pp @@ -0,0 +1,11 @@ +{ %fail } +program test; + +procedure proc(var values: array of string); +begin + values := ['hi']; // project1.lpr(5,10) Error: Assignments to formal parameters and open arrays are not possible + // project1.lpr(5,13) Error: Internal error 99080501 +end; + +begin +end.