[Issue 8868] New: overload resolution of &x.g() incorrectly chooses delegate over function pointer

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Oct 22 06:20:54 PDT 2012


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

           Summary: overload resolution of &x.g() incorrectly chooses
                    delegate over function pointer
           Product: D
           Version: D1 & D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: clugdbug at yahoo.com.au


--- Comment #0 from Don <clugdbug at yahoo.com.au> 2012-10-22 06:20:51 PDT ---
..or vice versa.
Reported by kenji in the pull request for bug 8257.
https://github.com/D-Programming-Language/dmd/pull/1194
-----
struct S8257 {
    void g(int n){} // before the static one
    static int g() { return 6; }
}
void main() {
     auto k = &(func()).g;
     pragma(msg, typeof(k));  // prints void delegate(int n)
}

It always chooses the first function declaration.

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