[Issue 5290] Static array literals with too few elements

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Sep 9 11:34:51 PDT 2011


http://d.puremagic.com/issues/show_bug.cgi?id=5290



--- Comment #7 from bearophile_hugs at eml.cc 2011-09-09 11:34:38 PDT ---
(In reply to comment #6)

> Code like the following is working as designed, so if your patch refuses this
> code, then your patch is implementing an enhancement too (it means it's
> changing the D specs):
> 
> int[3] arr = [1, 2];
> void main() {}


Note: For the situations where people want to specify less items than the
arrays length I suggested an *explicit* syntax, like:

int[3] arr = [1, 2, ...];
void main() {}

-- 
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