Bug 4224 – alias this and opDispatch

Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
Other
OS
Linux
Creation time
2010-05-23T03:07:00Z
Last change time
2011-10-23T22:20:39Z
Assigned to
nobody
Creator
pelle.mansson

Comments

Comment #0 by pelle.mansson — 2010-05-23T03:07:15Z
This structure: struct A(T) { T[string] table; alias table this; T opDispatch(string s)() { return table[s]; } } void main() { A!int a; a["i"] = 4; writeln(a.i); } Gives the error: test.d(56): Error: undefined identifier module test.i I expected a.i to go to opDispatch when i was not found otherwise.
Comment #1 by simen.kjaras — 2010-11-30T03:19:42Z
*** This issue has been marked as a duplicate of issue 4989 ***
Comment #2 by schveiguy — 2010-11-30T05:24:46Z
This should be the original bug, not 4989
Comment #3 by schveiguy — 2010-11-30T05:25:15Z
*** Issue 4989 has been marked as a duplicate of this issue. ***
Comment #4 by k.hara.pg — 2011-10-23T22:20:39Z
*** This issue has been marked as a duplicate of issue 6434 ***