www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 13026] New: object.get cannot be called with [] as

https://issues.dlang.org/show_bug.cgi?id=13026

          Issue ID: 13026
           Summary: object.get cannot be called with [] as "defaultValue"
                    argument
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: regression
          Priority: P1
         Component: druntime
          Assignee: nobody puremagic.com
          Reporter: briancschott gmail.com

void main() {
    int[][string] mapping;
    int[] v = get(mapping, "test", []);
}

does not compile with 2.066 (git master)

Changing the code to this allows compilation to succeed:

void main() {
    int[][string] mapping;
    int[] v = get(mapping, "test", (int[]).init);
}

--
Jul 02 2014