[Issue 24783] New: ref and out declarations can be initialized with null references

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Sep 24 08:49:26 UTC 2024


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

          Issue ID: 24783
           Summary: ref and out declarations can be initialized with null
                    references
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: bugzilla at digitalmars.com

@safe:

  void test(ref int r, out int o);

  void foo() {
    int* p;
    test(*p, *p);
  }

compiles without complaint. They should get a null check.

--


More information about the Digitalmars-d-bugs mailing list