Bug 19849 – undefined identifier using identity specialization in specific circumstance

Status
NEW
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2019-05-06T14:33:45Z
Last change time
2024-12-13T19:03:13Z
Assigned to
No Owner
Creator
Adam D. Ruppe
Moved to GitHub: dmd#19561 →

Comments

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
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/19561 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB