Comment #0 by default_357-line — 2018-02-22T13:35:16Z
Comment #1 by default_357-line — 2018-02-22T13:36:55Z
Reproduce:
class Class {
invariant { new Object; }
void foo() @nogc { }
}
void test() @nogc {
(new Class).foo;
}
void main() { test(); }
Expected: error about gc allocation in @nogc violation
Outcome: runs silently
Further wrinkle:
void foo() @nogc in { new Object; } body { }
^ this one errors!
Either the second function should work (preferred) or the first one should also error.
Comment #2 by robert.schadek — 2024-12-13T18:57:15Z