www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 10627] New: Array ops with fixed sized arrays lose their length at function return point

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

           Summary: Array ops with fixed sized arrays lose their length at
                    function return point
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: bearophile_hugs eml.cc


--- Comment #0 from bearophile_hugs eml.cc 2013-07-13 03:14:38 PDT ---
alias Foo = float[2];
Foo bar(Foo x, Foo y) {
    Foo z = x[] + y[]; // OK
    return x[] + y[];  // error
}
void main() {}



DMD 2.064alpha gives:

test.d(4): Error: cannot implicitly convert expression (x[] + y[]) of type
float[] to float[2u]


See also Issue 10523

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