D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 19388 - [dip1000] scope return parameters should be safely assigned in scope constructor
Summary: [dip1000] scope return parameters should be safely assigned in scope constructor
Status: RESOLVED WORKSFORME
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P1 enhancement
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-11-10 09:04 UTC by Илья Ярошенко
Modified: 2021-03-15 07:36 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Илья Ярошенко 2018-11-10 09:04:12 UTC
struct C
{
    void* u;
    this(scope return void* v) @safe scope
    {
        this.u = v;
    }
}

<source>(6): Error: scope variable `v` assigned to `this` with longer lifetime

Compiler returned: 1

This DIP just ignores constructors. This cause a lot of issues during libraries updates.
Comment 1 moonlightsentinel 2021-03-15 07:36:23 UTC
Works with current master (>2.096.0)