http://d.puremagic.com/issues/show_bug.cgi?id=9575
Summary: __traits(compiles, mixin()) incorrectly returns false
Product: D
Version: D2
Platform: All
OS/Version: All
Status: NEW
Severity: normal
Priority: P2
Component: DMD
AssignedTo: [email protected]
ReportedBy: [email protected]
--- Comment #0 from [email protected] 2013-02-22 13:44:47 PST ---
DMD 2.062
void main()
{
enum test = "auto v = new int;";
pragma(msg, __traits(compiles, mixin(test))); // 'false'
mixin(test); // compiles
}
A workaround is to wrap the test code in braces:
enum test = "{auto v = new int;}"; // __traits(compiles) == true
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------