www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 17496] New: Ambiguous address taking of overloaded function

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

          Issue ID: 17496
           Summary: Ambiguous address taking of overloaded function is not
                    rejected.
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: eyal weka.io

struct S {
    int f() { return 4; }
    int f() { return 5; }
}

unittest {
    S s;
    static assert(!is(typeof(s.f())));
    static assert(!is(typeof({ int delegate() foo = &s.f; }))); // fails, it
ambiguously takes address
}

--
Jun 12