www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 999] New: Problem with auto and nested array literals

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

           Summary: Problem with auto and nested array literals
           Product: D
           Version: 1.007
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: wbaxter gmail.com


There seems to be a problem with automatic type deduction of
nested array literals.


import std.stdio;

// This one compiles, (but causes runtime access violation if used)
auto gfoo = [[1.0],[2.0]];

void main() {
   writefln(typeid(typeof(gfoo))); // --> double[1][2], ok


   // this one doesn't compile
   auto foo = [[1.0],[2.0]];

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

}


-- 
Feb 22 2007
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=999


thomas-dloop kuehne.cn changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         OS/Version|Windows                     |All





Added to DStress as
http://dstress.kuehne.cn/run/a/auto_19_A.d
http://dstress.kuehne.cn/run/a/auto_19_B.d


-- 
Feb 26 2007
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=999






*** Bug 919 has been marked as a duplicate of this bug. ***


-- 
Sep 27 2007
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=999


Don <clugdbug yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |clugdbug yahoo.com.au
         Resolution|                            |FIXED





This, the Dstress cases, and the cases in 919, all work in DMD1.045 and 2.030.
(Tested both Windows + Linux).

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Aug 12 2009