digitalmars.D.bugs - [Issue 16021] New: Template constraint bug
- via Digitalmars-d-bugs (32/32) May 12 2016 https://issues.dlang.org/show_bug.cgi?id=16021
https://issues.dlang.org/show_bug.cgi?id=16021 Issue ID: 16021 Summary: Template constraint bug Product: D Version: D2 Hardware: All URL: http://dlang.org/ OS: All Status: NEW Severity: normal Priority: P3 Component: dmd Assignee: nobody puremagic.com Reporter: eric makechip.com is(T : A!T) tells if T can automatically be converted to A!T. The last line below is doing just that, yet the template constraint does not work. class A(T) if (is(T : A!T)) { } // if (is(T : A!T)) gives this error: // Error: template instance x.A!(B) does not match // template declaration A(T) if (is(T : A!T)) // while looking for match for A!(B) class B : A!(B) { } void main(string[] args) { B b = new B(); A!B a = b; // compiles fine } --
May 12 2016