[Issue 11872] New: Support for overloaded template functions in with block

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Jan 5 12:18:58 PST 2014


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 at puremagic.com
        ReportedBy: longestpants at gmail.com


--- Comment #0 from Adam S <longestpants at 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: -------


More information about the Digitalmars-d-bugs mailing list