[Issue 10925] unittests qualified on the right hand side fail

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Sun Mar 22 04:29:20 PDT 2015


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

--- Comment #2 from Kenji Hara <k.hara.pg at gmail.com> ---
Historically invariant block needed parenthesis until 2.065.

class C {
    invariant {}    // Error until 2.065, allowed from 2.066
}

And "postfix attributes" is valid only for functions.

class C {
    void fun() pure { ... }    // OK
    int function() fptr pure;  // NG
}

If we allow postfix attributes on unittest and invariant blocks, I'd like to
force the empty parameter list `()` to make the syntax similar to functions.

class C {
    unittest() pure { ... }    // proposal
    invariant() pure nothrow { ... }
}

--


More information about the Digitalmars-d-bugs mailing list