[Issue 23300] std.array : array wrongly propagates scopeness of source

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Sep 17 05:14:32 UTC 2022


https://issues.dlang.org/show_bug.cgi?id=23300

ag0aep6g <ag0aep6g at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ag0aep6g at gmail.com

--- Comment #4 from ag0aep6g <ag0aep6g at gmail.com> ---
(In reply to Ate Eskola from comment #3)
> ------
> auto fun(int* ptr)
> { // comment out this line and this compiles
>   // as does if you explicitly mark either it or the argument scope
>   auto r = ptr;
>   return new int;
> }
> 
> @safe int* gun(scope int* ptr){return ptr.fun;}
> ------
> 
> Is the scope inference supposed to behave like this?

That's issue 20674 ("[DIP1000] inference of `scope` is easily confused").

--


More information about the Digitalmars-d-bugs mailing list