Skip to content
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

fix: expand array synonyms / subset types in LHS assignments #2884

Merged
merged 3 commits into from
Oct 27, 2022

Conversation

RustanLeino
Copy link
Collaborator

Previously, the type of LHSs in simultaneous assignments was used without first calling NormalizeExpand(). This had caused a crash when a LHS was a type synonym or subset type around an array type.

Fixes #2883

By submitting this pull request, I confirm that my contribution is made under the terms of the MIT license.

@RustanLeino RustanLeino marked this pull request as ready for review October 12, 2022 17:51
Copy link
Member

@MikaelMayer MikaelMayer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job fixing this crash. I'm not convinced however based on the code that TypeArgs is always non-empty at this point, but I guess I don't have the entire context and assumptions here.

@RustanLeino
Copy link
Collaborator Author

Since this code is in the verifier, we know the program has passed the resolver. The only legal types (after expanding synonyms and subset types) for SeqSelectExpr and MultiSelectExpr are seq and arrayN types, and each of these will have the TypeArgs field filled in (with at least one element).

@RustanLeino RustanLeino merged commit c6c0656 into dafny-lang:master Oct 27, 2022
@RustanLeino RustanLeino deleted the issue-2883 branch October 27, 2022 00:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Crash on simultaneous assignment to element of array synonym
2 participants