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

More tests for sum types: records as option content #14

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ivan-gavran
Copy link
Collaborator

This PR adds to the sum type in the quint model one option which has a record as its content.
This will hopefully be useful as a reference because Quint cheatsheet takes this as an example for sum types.

@ivan-gavran ivan-gavran requested a review from romac December 20, 2023 10:28
@romac
Copy link
Member

romac commented Dec 20, 2023

Great idea! I wonder if instead of adding a variant to Option we can instead define a new sum type and perhaps show two ways of having records with the variant in Rust, ie.

enum A {
  B(C),
  D { x: i32, y: bool }
}

where C is a struct, and with some better names.

What do you think?

@ivan-gavran
Copy link
Collaborator Author

Agree, it will make it clearer! I'll update the PR

@ivan-gavran ivan-gavran marked this pull request as draft December 21, 2023 10:38
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.

2 participants