Thread overview
[Issue 7759] Inconsistencies with Array Operations
Mar 24, 2012
Daniel
Mar 24, 2012
Daniel
Mar 24, 2012
Daniel
March 24, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7759



--- Comment #2 from Daniel <daniel350@bigpond.com> 2012-03-24 02:13:16 PDT ---
Its cases like this that are curious aswell.

void main() {
    int[] a = [3,3,3];
    int[2] y = a[] + a[]; // ok

    int[2] x = [3,3,3] + [3,3,3]; // error

    writeln(y);
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
March 24, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7759



--- Comment #3 from Daniel <daniel350@bigpond.com> 2012-03-24 02:27:57 PDT ---
If nothing else, the following must be a compiler bug, or otherwise a very unclear syntax;

int[2] fnc(int[2] a, int[2] b) {
    return a[] + b[]; // Error: cannot implicitly convert expression (a[] +
b[]) of type int[] to int[2LU]
}

int[2] fnc2(int[2] a, int[2] b) {
    int[2] x = a[] + b[];
    return x; // ok
}

regards,

Daniel :)

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
March 24, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7759



--- Comment #4 from Daniel <daniel350@bigpond.com> 2012-03-24 02:50:38 PDT ---
Possible duplicate of things pointed out in #3066

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