April 03, 2022 [Issue 22977] New: [dip1000] can escape scope pointer returned by nested function | ||||
|---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=22977 Issue ID: 22977 Summary: [dip1000] can escape scope pointer returned by nested function Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: normal Priority: P1 Component: dmd Assignee: nobody@puremagic.com Reporter: dkorpel@live.nl Nested function `fn` does not get `return` inferred here: ``` int* gPtr; void main() @safe { scope int* sPtr; int* fn() { return sPtr; } gPtr = fn(); } ``` -- | ||||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply