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


--- Comment #0 from Adam S <longestpants gmail.com> 2014-01-05 12:18:57 PST ---
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


--- Comment #1 from Kenji Hara <k.hara.pg gmail.com> 2014-01-05 21:40:47 PST ---
(In reply to comment #0)
 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



--- Comment #2 from github-bugzilla puremagic.com 2014-02-27 12:38:17 PST ---
Commit pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/5ffe893583f149dd182ad323e93bdf17ca1c2165
Merge pull request #3065 from 9rnsr/fix11872

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