[Issue 22982] Can't copy scope range elements into a returned array

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Apr 7 15:22:55 UTC 2022


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

ag0aep6g <ag0aep6g at gmail.com> changed:

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

--- Comment #3 from ag0aep6g <ag0aep6g at gmail.com> ---
(In reply to Atila Neves from comment #2)
> I don't know if transitivity has anything to do with it, since the element
> is scope. 
> 
> Conceptually, I think return scope on `only` should allow me to return an
> array from it.

`scope` is not a type qualifier. You cannot have a dynamic array of `scope`
things. `scope` always applies to the outermost indirection(s) of a variable
(ignoring `ref`).

If you think `scope` should work differently, you will probably have to
re-design the whole thing.

--


More information about the Digitalmars-d-bugs mailing list