digitalmars.D.bugs - [Issue 23985] New: [dip1000] return scope fails to infer after
- d-bugmail puremagic.com (46/47) Jun 10 2023 https://issues.dlang.org/show_bug.cgi?id=23985
https://issues.dlang.org/show_bug.cgi?id=23985 Issue ID: 23985 Summary: [dip1000] return scope fails to infer after assignment Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: normal Priority: P1 Component: dmd Assignee: nobody puremagic.com Reporter: dkorpel live.nlFrom the newsgroup:https://forum.dlang.org/post/ooxbnqweqyohygrvspga forum.dlang.org ```D // REQUIRED_ARGS: -preview=dip1000 safe: struct B() { int* a; C!() c; } class C() { C!() foo(int* a) { return foo2(a); } C!() foo2(int* a) { auto b = B!()(a); return b.c; } } void main() { scope int* a; C!() c; // Error: scope variable `a` assigned to non-scope parameter `a` calling `foo` c.foo(a); } a); } ``` --
Jun 10 2023