[Issue 14803] New: successful static assert can change result of compilation
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Fri Jul 17 08:05:14 PDT 2015
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: nobody at puremagic.com
Reporter: r.sagitario at gmx.de
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
--
More information about the Digitalmars-d-bugs
mailing list