mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-02 03:50:35 +02:00
* dont' allow assignments to array of const, resolves #41230
This commit is contained in:
parent
2d6a0d59f0
commit
4cae231a52
@ -746,7 +746,7 @@ implementation
|
||||
maybe_call_procvar(right,true);
|
||||
|
||||
{ assignments to formaldefs and open arrays aren't allowed }
|
||||
if is_open_array(left.resultdef) then
|
||||
if is_open_array(left.resultdef) or is_array_of_const(left.resultdef) then
|
||||
begin
|
||||
CGMessage(type_e_assignment_not_allowed);
|
||||
result:=cerrornode.create;
|
||||
|
11
tests/webtbf/tw41230.pp
Normal file
11
tests/webtbf/tw41230.pp
Normal file
@ -0,0 +1,11 @@
|
||||
{ %fail }
|
||||
program app;
|
||||
{$mode objfpc}
|
||||
|
||||
procedure test(a: array of const);
|
||||
begin
|
||||
a := [1, 2, 3];
|
||||
end;
|
||||
|
||||
begin
|
||||
end.
|
Loading…
Reference in New Issue
Block a user