[Issue 10047] New: getOverloads cannot resolve UFCS

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed May 8 06:26:37 PDT 2013


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

           Summary: getOverloads cannot resolve UFCS
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: regression
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: zan77137 at nifty.com


--- Comment #0 from SHOO <zan77137 at nifty.com> 2013-05-08 06:26:35 PDT ---
This code doesn't work:
----------
//import std.typecons;
struct Typedef(T){
    T a;
    template opDispatch(string name) {
        static if (__traits(getOverloads, a, name).length != 0) { }
    }
}
struct A {}
void foo(Typedef!A a) {}

void main()
{
    Typedef!A a;
    a.foo();
}
-----------

$ dmd -run main
main.d(5): Error: function main.foo (Typedef!(A) a) is not callable using
argume
nt types (A)
main.d(5): Error: a.foo cannot be resolved
main.d(14): Error: template instance
main.Typedef!(A).Typedef.opDispatch!("foo")
 error instantiating
main.d(14): Error: function expected before (), not a.(__error) of type _error_

-----------

git bisect result:

   5d7ccff11d5bc91824bda7b66edca6318742f80b is the first bad commit

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