Bug 9504 – typeof does not look up properties correctly on template argument

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-02-13T00:04:00Z
Last change time
2013-11-22T23:36:42Z
Keywords
pull, rejects-valid
Assigned to
nobody
Creator
k.hara.pg

Comments

Comment #0 by k.hara.pg — 2013-02-13T00:04:13Z
struct Bar { template Abc(T) { T y; } enum size_t num = 123; class Def {} } template GetSym(alias sym) { } template GetExp(size_t n) { } template GetTyp(T) { } alias GetSym!(typeof(Bar.init).Abc) X; // NG alias GetExp!(typeof(Bar.init).num) Y; // NG alias GetTyp!(typeof(Bar.init).Def) Z; Bar func() { alias GetSym!(typeof(return).Abc) V; // NG alias GetExp!(typeof(return).num) W; // NG alias GetTyp!(typeof(return).Def) X; return Bar(); }
Comment #1 by k.hara.pg — 2013-02-13T07:18:21Z
Comment #2 by github-bugzilla — 2013-02-15T12:12:30Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/e877fb2e47c197427cfa1c50039a563a31e2d7f5 fix Issue 9504 - typeof does not look up properties correctly on template argument The identifiers followed by typeof(exp) or typeod(return) may be resolved to symbol or expression. Type[Typeof|Return]::resolve should consider it. https://github.com/D-Programming-Language/dmd/commit/0c33e5e0547dd5313e0d7c12b1c15d2fc5deeb97 Merge pull request #1659 from 9rnsr/fix_typeof Issue 9504 - typeof does not look up properties correctly on template argument