[Issue 2712] error with passing an array slot as another array length to new

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Jan 27 02:43:26 PST 2010


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


Don <clugdbug at yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |clugdbug at yahoo.com.au
            Version|unspecified                 |1.00


--- Comment #1 from Don <clugdbug at yahoo.com.au> 2010-01-27 02:43:25 PST ---
This is a parsing error. Workaround: Adding () around the x[n] allows it to
compile.

void foo(uint n, in uint[] x) {
    auto y = new uint[ (x[n]) ];
}

void main() {
    foo(7, new uint[10]);
}

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