Array assignment is allowed yet it does nothing
Original Reporter info from Mantis: kluug.net @onpok
-
Reporter name: Ondrej Pokorny
Original Reporter info from Mantis: kluug.net @onpok
- Reporter name: Ondrej Pokorny
Description:
See the test code in "Steps To Reproduce":
myArray := [aArray]; // both myArray and aArray are "array of string";
is allowed yet it does nothing. It should be either disallowed (=compile error) or it should copy aArray into myArray.
Steps to reproduce:
program Project1;
{$mode objfpc}
procedure AssignArray(const aArray: array of string);
var
myArray: array of string;
S: string;
begin
myArray := [aArray]; // << no compiler error, yet no assignment is executed
Writeln('Length(myArray): ', Length(myArray));
for S in myArray do
Writeln(S);
end;
begin
AssignArray(['abc', 'xyz']);
end.
Mantis conversion info:
- Mantis ID: 34355
- Version: 3.3.1
- Fixed in version: 3.3.1
- Fixed in revision: 39882 (#a8b2ad31)