Bug 23380 – [dip1000] class parameter should not be treated as ref qua lifetime

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2022-09-28T11:19:00Z
Last change time
2022-09-29T15:21:24Z
Assigned to
No Owner
Creator
Dennis

Comments

Comment #0 by dkorpel — 2022-09-28T11:19:00Z
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.
Comment #1 by dkorpel — 2022-09-29T15:21:24Z