[Issue 8374] New: One missed array literal interpretation as int[2]

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Jul 10 15:18:43 PDT 2012


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

           Summary: One missed array literal interpretation as int[2]
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            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 2012-07-10 15:18:42 PDT ---
I am not sure, but I think this code is correct:


struct Foo {
    int[2] bar;
}
const(int[2]) spam() {
    const Foo* x;
    return true ? x.bar : [10, 20];
}
void main() {}


But DMD 2.060alpha gives:

test.d(6): Error: cannot implicitly convert expression
(cast(const(int)[])(*x).bar) of type const(int)[] to const(int[2u])

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