Either I do not understand the work of this feature or it is an obvious bug:

import std.stdio;
import std.conv;

void main()
{
enum string expr = "DMD compiles this garbage ... iiiii - \" #### $$$";
        
   enum bool bTest = __traits(compiles, expr);
   enum bool bTest2 = __traits(compiles, "int i = q{};");
                
   writeln("bTest: " ~ to!string(bTest));
   writeln("bTest2: " ~ to!string(bTest2));
}

Produces (tested with dmd32 2.060 and dmd32 2.059):
  bTest: true
  bTest2: true

(http://dpaste.dzfl.pl/5d338ab3)

Could you please somebody explain this?

Thanks,
Pavel

Reply via email to