[Issue 9913] New: static if (__traits(compiles)...) causes program to hang
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Tue Apr 9 13:37:50 PDT 2013
http://d.puremagic.com/issues/show_bug.cgi?id=9913
Summary: static if (__traits(compiles)...) causes program to
hang
Product: D
Version: D2
Platform: All
OS/Version: All
Status: NEW
Severity: normal
Priority: P2
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: callumenator at gmail.com
--- Comment #0 from callumenator at gmail.com 2013-04-09 13:37:49 PDT ---
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.
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list