Bug 17223 – Inconsistency between opDispatch explicit/implicit usage

Status
RESOLVED
Resolution
WORKSFORME
Severity
major
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2017-02-24T19:43:43Z
Last change time
2022-11-16T15:41:15Z
Assigned to
No Owner
Creator
John Colvin

Comments

Comment #0 by john.loughran.colvin — 2017-02-24T19:43:43Z
alias AliasSeq(TL ...) = TL; int n; struct S { alias A = AliasSeq!(n, int); template opDispatch(string name) { alias this_ = this; alias opDispatch = AliasSeq!(__traits(getMember, this_, "A")); } } alias b = S.opDispatch!"B"; // OK alias a = S.B; // Error: alias test.a cannot alias an expression tuple(n, (int))
Comment #1 by razvan.nitu1305 — 2022-11-16T15:41:15Z
I get the same error message: test.d(8): Error: undefined identifier `this`, did you mean alias `this_`? test.d(13): Error: template instance `test.S.opDispatch!"B"` error instantiating and test.d(8): Error: undefined identifier `this`, did you mean alias `this_`? test.d(14): Error: template instance `test.S.opDispatch!"B"` error instantiating So this seems to be fixed.