www.digitalmars.com         C & C++   DMDScript  

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

reply d-bugmail puremagic.com writes:
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 puremagic.com
        ReportedBy: sandford jhu.edu


--- Comment #0 from Rob Jacques <sandford 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: -------
Nov 24 2009
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3548


Don <clugdbug yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch
                 CC|                            |clugdbug yahoo.com.au


--- Comment #1 from Don <clugdbug yahoo.com.au> 2010-05-18 00:23:53 PDT ---
The patch for bug 2276 fixes this.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 18 2010
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3548


Walter Bright <bugzilla digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |bugzilla digitalmars.com
         Resolution|                            |FIXED


--- Comment #2 from Walter Bright <bugzilla digitalmars.com> 2010-05-31
19:45:20 PDT ---
http://www.dsource.org/projects/dmd/changeset/509

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