View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0034355 | FPC | Compiler | public | 2018-09-29 15:06 | 2018-10-07 19:58 |
Reporter | Ondrej Pokorny | Assigned To | Sven Barth | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Product Version | 3.3.1 | Product Build | |||
Target Version | Fixed in Version | 3.3.1 | |||
Summary | 0034355: Array assignment is allowed yet it does nothing | ||||
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. | ||||
Tags | No tags attached. | ||||
Fixed in Revision | 39882 | ||||
FPCOldBugId | |||||
FPCTarget | |||||
Attached Files |
|
|
>both myArray and aArray are "array of string"; aArray is open array of AnsiString and myArray is dynamic array of AnsiString |
|
> aArray is open array of AnsiString and myArray is dynamic array of AnsiString [aArray] however is of the same type as myArray (notice the brackets). Remove the brackets around aArray and the compiler will complain that one is an open array, the other a dynamic array. |
|
No, the type of [aArray] would be "array of (open) array of String". |
|
In that case the assignment should be illegal? |
|
Definitely. |
|
Please test and close if okay. |
|
Works well, thank you. |
Date Modified | Username | Field | Change |
---|---|---|---|
2018-09-29 15:06 | Ondrej Pokorny | New Issue | |
2018-09-29 19:18 | delfion | Note Added: 0111086 | |
2018-09-29 22:56 | Bart Broersma | Note Added: 0111090 | |
2018-09-29 22:57 | Bart Broersma | Note Edited: 0111090 | View Revisions |
2018-09-30 15:46 | Sven Barth | Note Added: 0111114 | |
2018-09-30 15:50 | Bart Broersma | Note Added: 0111115 | |
2018-09-30 16:18 | Sven Barth | Assigned To | => Sven Barth |
2018-09-30 16:18 | Sven Barth | Status | new => assigned |
2018-09-30 16:18 | Sven Barth | Note Added: 0111117 | |
2018-10-07 14:27 | Sven Barth | Fixed in Revision | => 39882 |
2018-10-07 14:27 | Sven Barth | Note Added: 0111300 | |
2018-10-07 14:27 | Sven Barth | Status | assigned => resolved |
2018-10-07 14:27 | Sven Barth | Fixed in Version | => 3.3.1 |
2018-10-07 14:27 | Sven Barth | Resolution | open => fixed |
2018-10-07 19:58 | Ondrej Pokorny | Note Added: 0111314 | |
2018-10-07 19:58 | Ondrej Pokorny | Status | resolved => closed |