--- Comment #2 from Max Samukha <> 2011-03-12 01:53:09 
PST ---
No, no. The bug is not about the impossibility to build a closure. It is about
__traits(compiles) not handling the compilation error properly. It should
suppress the error and evaluate to false.  

Another example:

struct S

void main()
    S s;    
    static if (__traits(compiles, { auto s1 = s; }))
        pragma(msg, "Can build closure");
        pragma(msg, "Cannot build closure");
The compiler outputs:
Can build closure
Error: variable test.main.s has scoped destruction, cannot build closure

Instead, the above should compile successfully, printing "Cannot build closure"
at compile time.

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to