[Issue 3374] New: Associative array type not inferred

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Oct 8 08:43:26 PDT 2009


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

           Summary: Associative array type not inferred
           Product: D
           Version: unspecified
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: andrei at metalanguage.com


--- Comment #0 from Andrei Alexandrescu <andrei at metalanguage.com> 2009-10-08 08:43:25 PDT ---
The error when trying to compile this snippet:

auto famousNamedConstants = 
    [ "pi" : 3.14, "e" : 2.71, "moving sofa" : 2.22 ];

is:

Error: cannot infer type from this array initializer
dmd: init.c:420: virtual Expression* ArrayInitializer::toExpression():
Assertion `0' failed.

Changing the sample to the following works:

double[string] famousNamedConstants = 
    [ "pi" : 3.14, "e" : 2.71, "moving sofa" : 2.22 ];

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


More information about the Digitalmars-d-bugs mailing list