[Issue 3548] New: ICE occurs when an array is returned from a function is incorrectly used in an array op expression.

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Nov 24 11:05:03 PST 2009


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

           Summary: ICE occurs when an array is returned from a function
                    is incorrectly used in an array op expression.
           Product: D
           Version: 2.036
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Keywords: ice-on-invalid-code
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: sandford at jhu.edu


--- Comment #0 from Rob Jacques <sandford at jhu.edu> 2009-11-24 11:05:02 PST ---
If an array is returned from a function and then used incorrectly in an array
op expression, an error without line number or file name is reported. Applies
to both static and dynamic arrays.


float[3] foo(float[3] a) { return a; }
void main(string[] args) {
    float[3] a;
    float[3] b;
    float[3] c = a[] + b[] + a.foo; // disappears with  a.foo[]
}

Error: incompatible types for (((p0[p]) + (p1[p])) + (c2)): 'const(float)' and
'float[3u]'

-or-

float[] foo(float[] a) { return a; }
void main(string[] args) {
    float[] a;
    float[] b;
    float[] c;
    c[] = a[] + b[] + a.foo;
}

Error: incompatible types for (((p0[p]) + (p1[p])) + (c2)): 'const(float)' and
'float[]'

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