Bug 20341 – [REG 2.063] 'this' required for explicit instantiation of template member function using template this

Status
RESOLVED
Resolution
DUPLICATE
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2019-10-30T21:35:32Z
Last change time
2023-03-16T15:07:12Z
Keywords
diagnostic, rejects-valid
Assigned to
No Owner
Creator
Simen Kjaeraas
See also
https://issues.dlang.org/show_bug.cgi?id=14484

Comments

Comment #0 by simen.kjaras — 2019-10-30T21:35:32Z
struct S { void fun(int i, this This)() { } void gun() { // Works: this.fun!0(); // Fails: fun!0(); } } According to https://run.dlang.io/is/CKwb4V, this used to work up until 2.062.
Comment #1 by schveiguy — 2023-03-16T15:04:53Z
Just ran into this. I'm surprised this is still an issue. Happens with classes as well. ```d class C { void foo(this T)() {} } class D : C { void bar() { foo(); } } ``` The error I get is: ``` onlineapp.d(8): Error: none of the overloads of template `onlineapp.C.foo` are callable using argument types `!()()` onlineapp.d(3): Candidate is: `foo(this T)()` ```
Comment #2 by schveiguy — 2023-03-16T15:07:12Z
*** This issue has been marked as a duplicate of issue 14484 ***