Comment #0 by destructionator — 2019-05-06T14:33:45Z
---
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.
Comment #1 by robert.schadek — 2024-12-13T19:03:13Z