[Issue 3849] New: [missing error] Array literal length doesn't match
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Wed Feb 24 01:56:21 PST 2010
http://d.puremagic.com/issues/show_bug.cgi?id=3849
Summary: [missing error] Array literal length doesn't match
Product: D
Version: 2.040
Platform: All
OS/Version: Windows
Status: NEW
Severity: normal
Priority: P2
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: bearophile_hugs at eml.cc
--- Comment #0 from bearophile_hugs at eml.cc 2010-02-24 01:56:19 PST ---
This small program compiles, but I'd like the compiler to raise a compile
error, because I think this is often a bug:
string[4] arr = ["foo", "bar"];
void main() {}
------------
A related enhancement: when I want to define a fixed-sized array with a literal
and the number of its items is high, I may not want to count them. In this
situation the following syntax can be adopted:
int[$] arr = [10,2,15,15,14,12,3,7,13,5,9,9,7,9,9,9,11,15,1,1,12,5,14];
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list