Bug 14348 – typeof(x).ident is not accepted as a symbol

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2015-03-27T10:14:00Z
Last change time
2015-06-17T21:03:17Z
Keywords
pull, rejects-valid
Assigned to
nobody
Creator
yebblies

Comments

Comment #0 by yebblies — 2015-03-27T10:14:39Z
I don't see any reason why this shouldn't work: class B { int foo() { return 0; } } class C : B { override int foo() { return 1; } alias superfoo = typeof(super).foo; alias thisfoo = typeof(this).foo; } void main() { assert(&B.foo is &C.superfoo); assert(&C.foo is &C.thisfoo); } The current implementation requires the typeof(a).b expression evaluates to both a type and a symbol, when only a symbol is required.
Comment #1 by yebblies — 2015-03-27T10:30:23Z
Comment #2 by github-bugzilla — 2015-03-28T03:46:25Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/a10cb266a31c30bc3afd5d50ad629dc75dd2649f Fix Issue 14348 - typeof(x).ident is not accepted as a symbol Instead of evaluating as a type and then converting to a symbol, re-use the resolve logic to find the symbol. https://github.com/D-Programming-Language/dmd/commit/a902948fa353111aa6ed11a2717d8d2d0a438c98 Merge pull request #4521 from yebblies/issue14348 Issue 14348 - typeof(x).ident is not accepted as a symbol
Comment #3 by github-bugzilla — 2015-06-17T21:03:17Z