[Issue 23380] New: [dip1000] class parameter should not be treated as ref qua lifetime

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Sep 28 11:19:00 UTC 2022


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

          Issue ID: 23380
           Summary: [dip1000] class parameter should not be treated as ref
                    qua lifetime
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: dkorpel at live.nl

This should pass:
```
@safe void test(scope Object o0, scope Object o1)
{
    o1 = o0; // Error: scope variable `o0` assigned to `o1` with longer
lifetime
}
```

It doesn't because dmd currently considers o1 a `ref` parameter qua lifetime.

--


More information about the Digitalmars-d-bugs mailing list