www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 11872] New: Support for overloaded template functions in with block

reply d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=11872

           Summary: Support for overloaded template functions in with
                    block
           Product: D
           Version: D2
          Platform: x86_64
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: longestpants gmail.com



When using a 'with' statement, attempting to call an overloaded template
function produces an error.

---------------
class Foo {
    auto test(int v)() {}
    auto test(int v)(string) {}
}

auto bar = new Foo;

with (bar) {
    //test!2();      //fails
    bar.test!2();  //works
}
---------------

When the comments are removed, the above produces:
    Error: need 'this' for 'test' of type 'pure nothrow  safe void()'

Calling non-overloaded template functions works as expected.

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 05 2014
next sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=11872


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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull, rejects-valid
           Platform|x86_64                      |All
         OS/Version|Linux                       |All
           Severity|enhancement                 |major




 Calling non-overloaded template functions works as expected.
I think there should be no difference, so I change "Importance" to major. Compiler fix: https://github.com/D-Programming-Language/dmd/pull/3065 -- Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jan 05 2014
prev sibling next sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=11872




Commit pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/5ffe893583f149dd182ad323e93bdf17ca1c2165


Issue 11872 - Support for overloaded template functions in with block

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 27 2014
prev sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=11872


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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 27 2014