www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 10538] New: std.typecons.wrap should consider opDispatch

reply d-bugmail puremagic.com writes:
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 puremagic.com
        ReportedBy: k.hara.pg gmail.com


--- Comment #0 from Kenji Hara <k.hara.pg 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: -------
Jul 04 2013
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10538


Kenji Hara <k.hara.pg gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull


--- Comment #1 from Kenji Hara <k.hara.pg gmail.com> 2013-07-04 01:10:23 PDT ---
https://github.com/D-Programming-Language/phobos/pull/1386

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jul 04 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10538



--- Comment #2 from github-bugzilla puremagic.com 2013-09-26 05:55:15 PDT ---
Commits pushed to master at https://github.com/D-Programming-Language/phobos

https://github.com/D-Programming-Language/phobos/commit/01f9455fac16dd793949714295eca9713ed07af7
fix Issue 10538 - std.typecons.wrap should consider opDispatch

https://github.com/D-Programming-Language/phobos/commit/36aa69b5ff06980dca4e31df046c122a50f75c22
Merge pull request #1386 from 9rnsr/fix_wrap

Issue 10536 & 10538 - std.typecons.wrap/unwrap bug fix and improvement

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Sep 26 2013
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10538


Andrej Mitrovic <andrej.mitrovich gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |andrej.mitrovich gmail.com
         Resolution|                            |FIXED


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Sep 26 2013