[Issue 3889] Forbid null as representation of empty dynamic array
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sun Apr 6 03:16:16 PDT 2014
https://d.puremagic.com/issues/show_bug.cgi?id=3889
--- Comment #16 from bearophile_hugs at eml.cc 2014-04-06 03:16:04 PDT ---
This difference shows another reason to forbid the usage of "null" as array
literal (found thanks to "anonymous":):
void main() {
import std.stdio: writeln;
int[][] a;
writeln(a.length);
a ~= [];
writeln(a.length);
a ~= null;
writeln(a.length);
}
Output:
0
0
1
--
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list