Skip to content

Fixed invalid type annotation for multivalue returns#4210

Merged
daxpedda merged 4 commits intowasm-bindgen:mainfrom
RunDevelopment:issue4207
Oct 31, 2024
Merged

Fixed invalid type annotation for multivalue returns#4210
daxpedda merged 4 commits intowasm-bindgen:mainfrom
RunDevelopment:issue4207

Conversation

@RunDevelopment
Copy link
Copy Markdown
Contributor

fixes #4207

Array itself is not a valid type because it requires one generic parameter. I replaced it with number[]. I chose number as the element type, because that's what the surrounding code is using for everything.

Using number for everything is probably wrong, since WASM uses bigint for 64-bit ints AFAIK, but it shouldn't matter too much.

@RunDevelopment
Copy link
Copy Markdown
Contributor Author

CI fails because CI uses the latest stable compiler (Rust 1.82 now), which uses multi-value returns by default. This means that the generated WASM and JS code will be different in all tests now.

Copy link
Copy Markdown
Member

@daxpedda daxpedda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we should probably read out the ValueType, but this is already a bug, so this doesn't degrade the current state.

@daxpedda daxpedda merged commit 37b9aa5 into wasm-bindgen:main Oct 31, 2024
@RunDevelopment RunDevelopment deleted the issue4207 branch October 31, 2024 17:41
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.

Functions returning Result<T,E> result in incorrect typescript function output type Array

2 participants