Thread overview
[Issue 18494] nogc ignores invariant
Feb 22, 2018
FeepingCreature
Dec 08, 2021
Stanislav Blinov
Dec 17, 2022
Iain Buclaw
February 22, 2018
https://issues.dlang.org/show_bug.cgi?id=18494

--- Comment #1 from FeepingCreature <default_357-line@yahoo.de> ---
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.

--
December 08, 2021
https://issues.dlang.org/show_bug.cgi?id=18494

Stanislav Blinov <stanislav.blinov@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |stanislav.blinov@gmail.com
           See Also|                            |https://issues.dlang.org/sh
                   |                            |ow_bug.cgi?id=4995

--
December 17, 2022
https://issues.dlang.org/show_bug.cgi?id=18494

Iain Buclaw <ibuclaw@gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P1                          |P4

--
December 13
https://issues.dlang.org/show_bug.cgi?id=18494

--- Comment #2 from dlangBugzillaToGithub <robert.schadek@posteo.de> ---
THIS ISSUE HAS BEEN MOVED TO GITHUB

https://github.com/dlang/dmd/issues/19394

DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB

--