[Issue 10326] Disallow 'invariant' for immutable, allow class/struct invariants without (), and later disallow usage of ()

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Mon May 12 00:38:24 PDT 2014


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

--- Comment #6 from bearophile_hugs at eml.cc ---
I'd like to reopen this issue because it's not done yet. The last missing step
is to (in future) give an error in line 2 of program, disallowing the () after
invariant:


struct Foo {
    invariant() {
        assert(false);
    }
    void bar() {}
}
unittest() {} // Not allowed.
void main() {
    Foo f;
    f.bar;
}

--


More information about the Digitalmars-d-bugs mailing list