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


bearophile_h...@eml.cc changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bearophile_h...@eml.cc


--- Comment #2 from bearophile_h...@eml.cc 2010-11-26 12:24:55 PST ---
I agree that this syntax is good:
int[$] arr = [1,2,3,4];

But it solves only half of the problem.
Currently this compiles:

int[4] a = [1, 2, 3];
void main() {}

While this generates:
object.Exception: lengths don't match for array copy

void main() {
    int[4] a = [1, 2, 3]; 
}

They are two different situations. But they don't look different, the first
just look like a special case.

To solve the second half of the problem someone has suggested this syntax that
looks good enough:
int[4] a = [1, 2, 3, ...];
a[3] is filled with typeof(a[0]).init.

For more info see bug 3849

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to