www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 706] New: incorrect type deduction for array literals in functions

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=706

           Summary: incorrect type deduction for array literals in functions
           Product: D
           Version: 0.177
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: thomas-dloop kuehne.cn


#
# auto x = [[1.0, 2.0], [3.0, 4.0]]; // works
#
# void foo(){
#   auto x = [[1.0, 2.0], [3.0, 4.0]]; // fails
# }
# 

Error: cannot implicitly convert expression ([[1,2],[3,4]]) of type
double[2][2] to double

test cases:
http://dstress.kuehne.cn/run/a/array_initialization_27_D.d
http://dstress.kuehne.cn/run/a/array_initialization_27_E.d


-- 
Dec 21 2006
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=706


bugzilla digitalmars.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED




------- Comment #1 from bugzilla digitalmars.com  2007-11-03 21:42 -------
Fixed dmd 1.023 and 2.007


-- 
Nov 03 2007