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

          Issue ID: 18757
           Summary: static invariant{} should either work or not be valid
                    syntax
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: minor
          Priority: P1
         Component: dmd
          Assignee: nob...@puremagic.com
          Reporter: default_357-l...@yahoo.de

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