www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 23380] New: [dip1000] class parameter should not be treated

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 puremagic.com
          Reporter: dkorpel 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.

--
Sep 28 2022