[Issue 10538] New: std.typecons.wrap should consider opDispatch

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Jul 4 00:51:57 PDT 2013


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

           Summary: std.typecons.wrap should consider opDispatch
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: Phobos
        AssignedTo: nobody at puremagic.com
        ReportedBy: k.hara.pg at gmail.com


--- Comment #0 from Kenji Hara <k.hara.pg at gmail.com> 2013-07-04 00:51:56 PDT ---
This code currently doesn't work, but it should.

import std.typecons;

interface Interface
{
    int foo();
    int bar(int);
}

class Pluggable
{
    int opDispatch(string name, A...)(A args) { return 100; }
}

void main()
{
    Interface i = wrap!Interface(new Pluggable());
    assert(i.foo() == 100);
    assert(i.bar(10) == 100);
}

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