DMD 2.062 Win32 import std.stdio, std.typecons; void main() { int ee = 0; static if (__traits(compiles, { Unique!int(&ee);})) auto e = Unique!int(&ee); writeln(e); // required to trigger } With the static if conditional (which passes) the writeln line causes the program to hang indefinitely after printing the expected result. Remove the static if conditional, and the program does not hang, behaves correctly.
(In reply to comment #0) Still present in 2.063 (Win32).
Not an ice, as dmd itself does not hang. The compiled program does. Removed ice keyword.
Looks like an infinite look inside the gc
loop*
Given example does not compile, an alternative version without Unique does not exhibit specified behaviour (Works since 2.067.old)