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();
}