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

Support for i64/u64 in interface types #1837

Open
ibaryshnikov opened this issue Oct 28, 2019 · 2 comments
Open

Support for i64/u64 in interface types #1837

ibaryshnikov opened this issue Oct 28, 2019 · 2 comments
Labels

Comments

@ibaryshnikov
Copy link
Member

Consider the following code

#[wasm_bindgen]
pub fn render() -> u64 {
    123
}

Compiling it with

WASM_INTERFACE_TYPES=1 wasm-pack build

produces

error: failed to generate a standard wasm bindings custom section
    caused by: failed to map return value for export `render` to standard binding expressions
    caused by: cannot represent 64-bit integer with a standard bindings expression

Expected behavior:
it should correctly generate interface type for the return value

In the proposal the types from u8/s8 to u64/s64 are covered, where u stands for unsigned and s for signed.

wasm-pack 0.8.1
wasm-bindgen 0.2.52
rustc 1.38.0 (625451e37 2019-09-23)

@alexcrichton
Copy link
Contributor

Thanks for the report! This is definitely something that I think we should support better in wasm-bindgen and is sort of "legacy baggage" from the JS target. I've opened up #1841 which is sort of the extension of this issue about how "pure interface types" isn't super well supported today since all the web functionality is mixed in. This would be fixed as part of a split proposed there.

@tiye
Copy link

tiye commented Nov 9, 2021

how is this issue in the end of 2021?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants