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

Exploring variant-to-variant coercion #6314

Merged
merged 9 commits into from
Jun 29, 2023
Merged

Conversation

zth
Copy link
Collaborator

@zth zth commented Jun 28, 2023

Allow coercing between variants which have the same exact constructors. We need to ensure that the runtime representation exactly matches as we coerce. The following restrictions are therefore in place:

  • Both variants must have the same configuration for @unboxed and @tag
  • Each constructor pair must have the same configuration of @as

@zth zth marked this pull request as ready for review June 28, 2023 18:56
@zth zth force-pushed the variant-to-variant-coercion branch from 82c288e to 6cdc49e Compare June 28, 2023 19:01
@zth zth requested a review from cristianoc June 28, 2023 19:03
@zth
Copy link
Collaborator Author

zth commented Jun 28, 2023

Probably need to check for unboxed too, right?

We already check that.

@zth zth merged commit 60cf75a into master Jun 29, 2023
14 checks passed
@zth zth deleted the variant-to-variant-coercion branch June 29, 2023 18:04
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.

None yet

2 participants