www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 10635] New: Error: cannot use array to initialize S

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 puremagic.com
        ReportedBy: kozzi11 gmail.com


--- Comment #0 from Daniel Kozak <kozzi11 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: -------
Jul 13 2013