Bug 9442 – typeid() doesn't work without `this.` for class fields

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-02-01T16:51:00Z
Last change time
2013-02-04T06:23:06Z
Keywords
pull, rejects-valid
Assigned to
nobody
Creator
andrej.mitrovich

Comments

Comment #0 by andrej.mitrovich — 2013-02-01T16:51:14Z
class C { this() { auto x = typeid(c); // L5 NG auto y = typeid(this.c); // ok } C c; } void main() { } $ test.d(5): Error: need 'this' to access member c
Comment #1 by k.hara.pg — 2013-02-01T23:57:08Z
Comment #2 by code — 2013-02-03T05:47:59Z
There is a workaround: typeid(typeof(this.c));
Comment #3 by github-bugzilla — 2013-02-04T00:36:40Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/c589ba59462f1609da564723a90a72b920ab8483 fix Issue 9442 - typeid() doesn't work without `this.` for class fields https://github.com/D-Programming-Language/dmd/commit/aa51dadc917ccd844fb4f30a456b9fb40f316694 Merge pull request #1595 from 9rnsr/fix9442 Issue 9442 - typeid() doesn't work without `this.` for class fields