template Bar() { void Bar() { error; } } template Foo() { enum Foo = __traits(compiles, Bar!()); } static assert(!Foo!());
This seems to have the same root cause as bug 965
Just a bit smaller testcase: --- void t()() { error; } static assert(!__traits(compiles, t!()())); // assertion fails static if(__traits(compiles, t!()())) { } // Error: undefined identifier ---
This bug is only for `static assert/if` not in a function: --- void t()() { error; } void f() { static assert(!__traits(compiles, t!()())); // passes static if(__traits(compiles, t!()())) { } // no errors } ---
Discussion related to this bug: https://forum.dlang.org/post/pjztqzrovuafonoeusnm@forum.dlang.org
All asserts in this issue pass under 2.075.1. Closing.