[Issue 9520] New: Wrong associative array literal interpretation

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Feb 16 07:23:54 PST 2013


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

           Summary: Wrong associative array literal interpretation
           Product: D
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: bearophile_hugs at eml.cc


--- Comment #0 from bearophile_hugs at eml.cc 2013-02-16 07:23:53 PST ---
struct Foo {
    int[int][char] aa;
}
void main() {
    auto f1 = Foo( ['A': [0: 10, 2: 20]] ); // OK
    Foo  f2 =    { ['A': [0: 10, 1: 20]] }; // Error.
}



DMD 2.062beta gives:

test.d(6): Error: cannot implicitly convert expression (['A':[10, 20]]) of type
int[][char] to int[int][char]


See also Issue 4703

-- 
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