[spec/statement] Clarify foreach restrictions#22917
[spec/statement] Clarify foreach restrictions#22917ntrel wants to merge 1 commit intodlang:masterfrom
foreach restrictions#22917Conversation
|
Thanks for your pull request and interest in making D better, @ntrel! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please see CONTRIBUTING.md for more information. If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment. Bugzilla referencesYour PR doesn't reference any Bugzilla issue. If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog. Testing this PR locallyIf you don't have a local development environment setup, you can use Digger to test this PR: dub run digger -- build "master + dmd#22917" |
| while `foreach` is iterating over the elements. | ||
| ) | ||
|
|
||
| $(UNDEFINED_BEHAVIOR If one of those operations occurs and it is `@system`.) |
There was a problem hiding this comment.
Does 'it' refer to the operation or the enclosing function? The latter makes more sense to me, but the wording implies the former.
There was a problem hiding this comment.
@dkorpel I think if the operation is allowed in @safe code, it should be implementation-defined iff it happens in @system code which doesn't do anything unsafe (or it does something unsafe that is unrelated to the operation).
Fixes #22910.