[Issue 21803] New: "@nogc:" incorrectly propagates into function blocks

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Apr 5 22:44:46 UTC 2021


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

          Issue ID: 21803
           Summary: "@nogc:" incorrectly propagates into function blocks
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: eyal at weka.io

This compiles successfully:

  struct S {
      @nogc
      void f() {
          scope dlg = { new int; };
      }
  }

Whereas this doesn't, because it complains the "new" violates @nogc.

  struct T {
      @nogc:
      void f() {
          scope dlg = { new int; };
      }
  }

--


More information about the Digitalmars-d-bugs mailing list