Bug 11872 – Support for overloaded template functions in with block

Status
RESOLVED
Resolution
FIXED
Severity
major
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-01-05T12:18:00Z
Last change time
2014-02-27T14:43:36Z
Keywords
pull, rejects-valid
Assigned to
nobody
Creator
longestpants

Comments

Comment #0 by longestpants — 2014-01-05T12:18:57Z
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.
Comment #1 by k.hara.pg — 2014-01-05T21:40:47Z
(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
Comment #2 by github-bugzilla — 2014-02-27T12:38:17Z
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