Skip to content

Represent Variant with a non-optional payload type#220

Merged
alexcrichton merged 1 commit intobytecodealliance:mainfrom
alexcrichton:variant-required-type
May 10, 2022
Merged

Represent Variant with a non-optional payload type#220
alexcrichton merged 1 commit intobytecodealliance:mainfrom
alexcrichton:variant-required-type

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 theahaco/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