[Issue 22916] [dip1000] copy of ref return still treated as scope variable
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Mon Aug 29 03:53:11 UTC 2022
https://issues.dlang.org/show_bug.cgi?id=22916
Walter Bright <bugzilla at digitalmars.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|REOPENED |RESOLVED
Resolution|--- |INVALID
--- Comment #9 from Walter Bright <bugzilla at digitalmars.com> ---
> The only thing my original example does differently is giving the pointer payload a different type (`int*` instead of `int`), which shouldn't affect this example since it's the second layer of indirection, it shouldn't be affected by `scope` or `return scope`.
That difference makes all the difference.
The trouble is the code is trying to store a scope protected value `int* p`
into the unprotected payload pointer `*ptr`. There's no way dip1000 can do
that. You'll have to use @trusted code.
--
More information about the Digitalmars-d-bugs
mailing list