digitalmars.D.bugs - [Issue 14286] New: `alias this` not considered sub-typing in is()
- via Digitalmars-d-bugs (42/42) Mar 15 2015 https://issues.dlang.org/show_bug.cgi?id=14286
https://issues.dlang.org/show_bug.cgi?id=14286 Issue ID: 14286 Summary: `alias this` not considered sub-typing in is() expression Product: D Version: D2 Hardware: x86_64 OS: Linux Status: NEW Severity: normal Priority: P1 Component: DMD Assignee: nobody puremagic.com Reporter: schuetzm gmx.net This works: class V(string s) { } class S(int U) : V!"xyz" { } void main() { S!10 a; static if(is(typeof(a) : V!Args, Args...)) pragma(msg, Args); else pragma(msg, "nope"); } This doesn't: struct V(string s) { } struct S(int U) { V!"xyz" x; alias x this; } void main() { S!10 a; static if(is(typeof(a) : V!Args, Args...)) pragma(msg, Args); else pragma(msg, "nope"); } As `alias this` should work wherever sub-typing works, I guess this is a bug. --
Mar 15 2015