[Issue 9575] New: __traits(compiles, mixin()) incorrectly returns false

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Feb 22 13:44:48 PST 2013


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: nobody at puremagic.com
        ReportedBy: callumenator at gmail.com


--- Comment #0 from callumenator at gmail.com 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: -------


More information about the Digitalmars-d-bugs mailing list