[Issue 17496] New: Ambiguous address taking of overloaded function is not rejected.

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Mon Jun 12 12:45:29 PDT 2017


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 at puremagic.com
          Reporter: eyal at 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
}

--


More information about the Digitalmars-d-bugs mailing list