Issue ID: 18757
           Summary: static invariant{} should either work or not be valid
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: minor
          Priority: P1
         Component: dmd

Right now, you can define a struct to have a static invariant:

struct S {
  static invariant { assert(false); }
  static void foo() { }

But the invariant will not be checked when calling foo.

Either this should work, or "static invariant {}" should be a syntax error.


Reply via email to