www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 17446] New: Static-assert passes/fails based on what follows

https://issues.dlang.org/show_bug.cgi?id=17446

          Issue ID: 17446
           Summary: Static-assert passes/fails based on what follows
           Product: D
           Version: D2
          Hardware: x86
                OS: Windows
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: dario.schiavon gmail.com

import std.traits : isAssignable;

struct MyStruct
{
    static assert(isAssignable!MyStruct);
    // fails, but passes if the following line is removed

    static if (isAssignable!MyStruct) {}
}

The assertion fails (wrongly IMO), but passes if the following static-if is
removed.

Using DMD32 v2.074.0 or LDC2 v1.1.1 (based on DMD v2.071.2).

See also https://issues.dlang.org/show_bug.cgi?id=17445

--
May 27 2017