March 30, 2022 [Issue 17934] [scope] scopeness entrypoint for unique/ref-counted missing | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=17934 Nick Treleaven <nick@geany.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |nick@geany.org --- Comment #9 from Nick Treleaven <nick@geany.org> --- (In reply to Mike Franklin from comment #7) > What about having `scope` apply to return values of functions, so `list()` > could be written as `scope List list() @trusted`? That might work there, but what about when a method wants to specify that the return value is `scope`? The `scope` attribute would be interpreted as applying to the `this` reference, when we might need a smaller scope. I really wish `this` parameter qualifiers were only allowed after the parameter list to avoid ambiguities. -- |
March 31, 2022 [Issue 17934] [scope] scopeness entrypoint for unique/ref-counted missing | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=17934 --- Comment #10 from Dlang Bot <dlang-bot@dlang.rocks> --- dlang/dmd pull request #13926 "Revert "fix Issue 17934 - [scope] scopeness entrypoint for unique/ref…" was merged into master: - 70d7a4799c62598d0f4ddc2d7ed3fcb0fd19e6f9 by Dennis Korpel: Revert "fix Issue 17934 - [scope] scopeness entrypoint for unique/ref-counted missing" This reverts commit 18ad1685dcdca65070f7a1d89efa4410a5936895. https://github.com/dlang/dmd/pull/13926 -- |
December 17, 2022 [Issue 17934] [scope] scopeness entrypoint for unique/ref-counted missing | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=17934 Iain Buclaw <ibuclaw@gdcproject.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Priority|P3 |P4 -- |
May 29, 2023 [Issue 17934] [scope] scopeness entrypoint for unique/ref-counted missing | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=17934 Paul Backus <snarwin+bugzilla@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |snarwin+bugzilla@gmail.com --- Comment #11 from Paul Backus <snarwin+bugzilla@gmail.com> --- One workaround for this is to pass the value to a callback as a scope parameter, rather than returning it: --- void withList(alias callback)() { scope l = (() @trusted => List(malloc(1)))(); callback(l); } void test() @safe { Elem elem; withList!((scope ref l) { elem = l.front; // scope variable `l` assigned to `elem` with longer lifetime }); } --- -- |
May 31, 2023 [Issue 17934] [scope] scopeness entrypoint for unique/ref-counted missing | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=17934 --- Comment #12 from Nick Treleaven <nick@geany.org> --- If you define `front` as `return`, *not* `return scope`: Elem front() @safe return You get an error for: elem = l.front; I think that fixes this issue, though that feature may need documenting. -- |
May 31, 2023 [Issue 17934] [scope] scopeness entrypoint for unique/ref-counted missing | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=17934 Dlang Bot <dlang-bot@dlang.rocks> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |pull --- Comment #13 from Dlang Bot <dlang-bot@dlang.rocks> --- @ntrel created dlang/dlang.org pull request #3619 "[spec/function] Document `return` parameters without `scope`" fixing this issue: - [spec/function] Document `return` parameters without `scope` Fixes Issue 17934 - [scope] scopeness entrypoint for unique/ref-counted missing. https://github.com/dlang/dlang.org/pull/3619 -- |
July 14 [Issue 17934] [scope] scopeness entrypoint for unique/ref-counted missing | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=17934 --- Comment #14 from Dlang Bot <dlang-bot@dlang.rocks> --- dlang/dlang.org pull request #3619 "[spec/function] Improve `return` struct method attribute docs" was merged into master: - 17763b0db20cc9978c0000c8729bd13f96f2987b by Nick Treleaven: [spec/function] Document `return` parameters without `scope` Part of Issue 17934 - [scope] scopeness entrypoint for unique/ref-counted missing. Add 'Struct Return Methods' subheading. https://github.com/dlang/dlang.org/pull/3619 -- |
Copyright © 1999-2021 by the D Language Foundation