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

Represent Variant with a non-optional payload type #220

Merged

Conversation

alexcrichton
Copy link
Member

This commit updates the internal representation of the Variant type to
have a non-optional payload type as well as no customizable tag type.
This brings the Variant type into alignment with the current canonical
ABI where the payload type is non-optional as well. The *.wit syntax
is not changing, however, where variant { foo } is sugar for
variant { foo(unit) }. Various code generators were tweaked as well to
get the new type representation to work as well.

This commit updates the internal representation of the `Variant` type to
have a non-optional payload type as well as no customizable `tag` type.
This brings the `Variant` type into alignment with the current canonical
ABI where the payload type is non-optional as well. The `*.wit` syntax
is not changing, however, where `variant { foo }` is sugar for
`variant { foo(unit) }`. Various code generators were tweaked as well to
get the new type representation to work as well.
@alexcrichton alexcrichton mentioned this pull request May 9, 2022
21 tasks
@peterhuene peterhuene self-requested a review May 9, 2022 23:28
@alexcrichton alexcrichton merged commit 8418206 into bytecodealliance:main May 10, 2022
@alexcrichton alexcrichton deleted the variant-required-type branch May 10, 2022 15:29
willemneal pushed a commit to AhaLabs/wit-bindgen that referenced this pull request May 31, 2022
…e#220)

This commit updates the internal representation of the `Variant` type to
have a non-optional payload type as well as no customizable `tag` type.
This brings the `Variant` type into alignment with the current canonical
ABI where the payload type is non-optional as well. The `*.wit` syntax
is not changing, however, where `variant { foo }` is sugar for
`variant { foo(unit) }`. Various code generators were tweaked as well to
get the new type representation to work as well.
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