wit-component: fix async task.return options for export signatures#2452
Merged
alexcrichton merged 3 commits intobytecodealliance:mainfrom Mar 2, 2026
Merged
Conversation
1d1a719 to
b66e264
Compare
b66e264 to
ddb2df5
Compare
crates/wit-component/tests/components/async-streams-and-futures/component.wat
Outdated
Show resolved
Hide resolved
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi maintainers,
DISCLAIMER : I generated this fix using AI
This PR addresses #2301 by ensuring async
task.returnoptions are derived from the full exported function signature, not only the immediate return type.What this changes
async-task-return-param-string) with snapshots that make the expectedtask.returnoptions explicit.task.returnby using the fullFunctioncontext.Why this fixes #2301
Issue #2301 reports invalid
task.returnsignature/options in async scenarios involving strings/encodings. This change propagates required canonical ABI options from the relevant async signature data, sotask.returnis emitted with the correct options in these cases.Notes
Testing
cargo test -p wit-component --test components async-task-return-param-stringcargo test -p wit-component --test components async-streams-and-futuresThank you for taking a look.