Closed ljmf00-wekaio closed 1 year ago
@dkorpel since you are more into dip1000, do you know any compiler issue on scope inference, that might affect these functions?
@dkorpel since you are more into dip1000, do you know any compiler issue on scope inference, that might affect these functions?
Issue 23300 - std.array : array wrongly propagates scopeness of source
Issue 20674 - [DIP1000] inference of scope
is easily confused
I don't think the workaround of returning scope pointers in a @trusted
lambda will stay working when https://github.com/dlang/dmd/pull/14236 gets merged. I think it's better to mark stringified
and getUpto
as @trusted
.
@dkorpel since you are more into dip1000, do you know any compiler issue on scope inference, that might affect these functions?
Issue 23300 - std.array : array wrongly propagates scopeness of source Issue 20674 - [DIP1000] inference of
scope
is easily confused
Thanks!
I don't think the workaround of returning scope pointers in a
@trusted
lambda will stay working when dlang/dmd#14236 gets merged. I think it's better to markstringified
andgetUpto
as@trusted
.
Yeah, my intention was not to trust the function call, but only the result.
I don't think the workaround of returning scope pointers in a
@trusted
lambda will stay working when dlang/dmd#14236 gets merged. I think it's better to markstringified
andgetUpto
as@trusted
.Yeah, my intention was not to trust the function call, but only the result.
I'll merge this then -- I "trust" you'll be back with another fix if that becomes necessary ;-)
Do you need me to tag a new release?
@veelo : Would be great if you could tag a new release as v2.101.0 is about to go out.
@veelo : Would be great if you could tag a new release as v2.101.0 is about to go out.
Maybe we can make the change suggested by @dkorpel instead, as my solution turns out to be "hackier" and not correct on casting away the scope (https://github.com/dlang/dmd/pull/14236#issuecomment-1256628770). I can make a PR fixing that and tag it afterwards?
TL;'DR; this hack will stop working on next compiler releases.
I can make a PR fixing that and tag it afterwards?
Sounds like a good plan.
CC @Geod24 See the new tag :)
Signed-off-by: Luís Ferreira luis.ferreira@weka.io
I believe this is either a phobos or a compiler issue on scope inference. Documentation/source code guarantees it copies the data, so no need to write an extra
.dup
/.idup
, just trust it doesn't escape a reference.