www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 919] New: auto type inference with nested arrays

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

           Summary: auto type inference with nested arrays
           Product: D
           Version: 1.004
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: minor
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: wbaxter gmail.com


Two issues here.  I'm guessing they're related so filing jointly.

Issue 1:
This won't compile:
-------
void main() { auto foo = [[1.0],[2.0]]; }
-------
"Error: cannot implicitly convert expression ([[1],[2]]) of type double[][2] to
double"


Issue 2:
This will compile:
----
import std.stdio;
auto foo = [[1.0],[2.0]];
void main() { writefln(foo); }
----
But it generates a runtime exception after printing the opening '[':
"[Error: Access Violation"


-- 
Feb 01 2007
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=919


smjg iname.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |smjg iname.com
             Status|NEW                         |RESOLVED
         Resolution|                            |DUPLICATE







*** This bug has been marked as a duplicate of 999 ***


-- 
Sep 27 2007