[Issue 10635] New: Error: cannot use array to initialize S

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Jul 13 11:09:49 PDT 2013


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

           Summary: Error: cannot use array to initialize S
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: kozzi11 at gmail.com


--- Comment #0 from Daniel Kozak <kozzi11 at gmail.com> 2013-07-13 11:09:48 PDT ---
struct S {
    string str;
    static S opCall(string[] v) {
        S s;
        s.str = v[0];
        return s; 
    }
    static S opCall(string[string] v) {
        S s;
        s.str = v.keys[0];
        return s; 
    }
}

S s = ["getnonce"]; // this works
S s = ["getnonce" : "str"]; // this doesnt work

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