www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 14803] New: successful static assert can change result of

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 puremagic.com
          Reporter: r.sagitario 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

--
Jul 17 2015