Bug 21743 – getOverloads fails to propagate 'this' expression for template member
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2021-03-21T20:53:46Z
Last change time
2021-04-11T12:26:00Z
Keywords
pull
Assigned to
No Owner
Creator
Boris Carvajal
Comments
Comment #0 by boris2.9 — 2021-03-21T20:53:46Z
struct A
{
int foo(int a) { return a; }
string foo()(string b) { return b; }
}
alias ov = __traits(getOverloads, A.init, "foo", true);
// member function works
static assert(ov[0](1) == 1);
// member template fails, gagged error:
// 'need this for foo of type pure nothrow @nogc @safe string(string b)'
static assert(ov[1]("a") == "a");
Comment #1 by dlang-bot — 2021-03-21T21:48:12Z
@BorisCarvajal created dlang/dmd pull request #12295 "Fix Issue 21743 - getOverloads fails to propagate 'this' expression …" fixing this issue:
- Fix Issue 21743 - getOverloads fails to propagate 'this' expression for template member
https://github.com/dlang/dmd/pull/12295
Comment #2 by dlang-bot — 2021-04-11T12:26:00Z
dlang/dmd pull request #12295 "Fix Issue 21743 - getOverloads fails to propagate 'this' expression …" was merged into master:
- 0b4b384e1e6e513fa8d7478657726277feb425e0 by Boris Carvajal:
Fix Issue 21743 - getOverloads fails to propagate 'this' expression for template member
https://github.com/dlang/dmd/pull/12295