[Issue 12660] Wrong non- at nogc function invariant error

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Mon May 12 10:15:16 PDT 2014


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

--- Comment #2 from bearophile_hugs at eml.cc ---
(In reply to yebblies from comment #1)
> I vaguely recall this being about attributes on the LHS of invariants being
> ignored.

If I put @nogc on the right:


class Foo {
    this() @nogc {}
    invariant() @nogc {}
}
void main() {}


temp.d(3,17): Error: statement expected to be { }, not @
temp.d(3,23): Error: basic type expected, not {
temp.d(3,23): Error: no identifier for declarator int
temp.d(3,23): Error: Declaration expected, not '{'
temp.d(5,15): Error: } expected following member declarations in aggregate

--


More information about the Digitalmars-d-bugs mailing list