https://issues.dlang.org/show_bug.cgi?id=14803
Issue ID: 14803
Summary: successful static assert can change result of
compilation
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: P1
Component: dmd
Assignee: [email protected]
Reporter: [email protected]
This compiles successfully:
enum hasElaborateAssign(T) = is(typeof(foo!T())) || true;
//static assert(hasElaborateAssign!int);
static assert(is(typeof(foo!int())));
void foo(T)()
{
static assert(hasElaborateAssign!T);
}
but when uncommenting the first assertion, the second assert fails with
error test.d(5): Error: static assert (is(typeof(__error))) is false
--