Bug 6805 – Can't use a type from opDispatch template

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2011-10-12T06:53:00Z
Last change time
2011-11-20T11:38:45Z
Keywords
patch, rejects-valid
Assigned to
nobody
Creator
verylonglogin.reg

Comments

Comment #0 by verylonglogin.reg — 2011-10-12T06:53:44Z
--- struct T { template opDispatch(string name) { alias int Type; } } pragma(msg, T.opDispatch!("xxx"), " ", T.xxx); //(T).opDispatch!("xxx") (T).opDispatch!("xxx") pragma(msg, T.opDispatch!("xxx").Type, " ", T.xxx.Type); //int int pragma(msg, is(T.opDispatch!("xxx").Type), " ", is(Flag.xxx.Type)); //true false template U(T) { } void main() { T.opDispatch!("xxx").Type i1; //ok T.xxx.Type i2; //Error: T.xxx.Type is used as a type alias U!(T.opDispatch!("xxx").Type) U1; //ok alias U!(T.xxx.Type) U2; //Error: template instance U!(int) does not match template declaration U(T) } ---
Comment #1 by k.hara.pg — 2011-10-13T22:23:34Z
Comment #2 by bugzilla — 2011-11-20T11:38:45Z