digitalmars.D.bugs - [Issue 19849] New: undefined identifier using identity
- d-bugmail puremagic.com (38/38) May 06 2019 https://issues.dlang.org/show_bug.cgi?id=19849
https://issues.dlang.org/show_bug.cgi?id=19849 Issue ID: 19849 Summary: undefined identifier using identity specialization in specific circumstance Product: D Version: D2 Hardware: x86_64 OS: Linux Status: NEW Severity: normal Priority: P1 Component: dmd Assignee: nobody puremagic.com Reporter: destructionator gmail.com --- struct Foo { disable this(U : U)(U i); this(U : uint)(U u) { } } void main() { Foo foo = 0u; } --- bug.d(2): Error: undefined identifier U Which I'm pretty sure shouldn't happen, since the identity specialization works in other cases, but since the other cases are with constraints so maybe not... --- struct Foo { disable this(U)(U i); this(U : U)(U u) if(is(U == uint)) { } } void main() { Foo foo = 0u; Foo foo2 = 0; } --- That works as I want, so the U:U pattern sometimes works. --
May 06 2019