-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Constraint on arrays used to determine implicit iterators. #3250
Comments
I'd prefer not allowing any assignment to the array as a whole inside the loop, as an easier requirement to formulate than that it should be possible to statically prove that any assignment maintains the size. The reason I'd prefer this over removing the constraint is that I'd like the use of implicit range to be a safe and natural way to avoid indexing out of range. |
I would also prefer this.
Yes, and obviously assigning to specific elements is safe - like:
Note that this suggestion also indicates how to check the current semantics; extract the size of the array at the start and assert that it is the same after each assignment to the entire array (if there are any). |
The specs say:
I suggests we remove the constraint on the fact that the size should not change during execution.
There are three reasons why I think this is a good idea:
In other words I think the following model:
should behave like
The text was updated successfully, but these errors were encountered: