Bug 3548 – ICE occurs when an array is returned from a function is incorrectly used in an array op expression.

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
Other
OS
Windows
Creation time
2009-11-24T11:05:00Z
Last change time
2015-06-09T01:27:02Z
Keywords
ice-on-invalid-code, patch
Assigned to
nobody
Creator
sandford

Comments

Comment #0 by sandford — 2009-11-24T11:05:02Z
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[]'
Comment #1 by clugdbug — 2010-05-18T00:23:53Z
The patch for bug 2276 fixes this.
Comment #2 by bugzilla — 2010-05-31T19:45:20Z