[Issue 5290] Static array literals with too few elements

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Jan 20 15:38:44 PST 2012


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


timon.gehr at gmx.ch changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |timon.gehr at gmx.ch


--- Comment #11 from timon.gehr at gmx.ch 2012-01-20 15:38:41 PST ---
Actually, it would be very cool if D would re-use the integer range trick here
and catch all cases that can be proven not to work using it, such that the
following code would error at compile time: ;)

int x;
readf("%d",&x);
real[2] foo = 
    x%100>50 ?
    [1.0L, 2.0L, 3.0L][0..2|x&1] :
    ([1.0L, 2.0L] ~ [3.0L, 4.0L] ~ 5.0L)[x&1..$-!(x&1)];

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