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

Intent use number / bigint union type #1426

Closed
sbc100 opened this issue Aug 8, 2024 · 4 comments
Closed

Intent use number / bigint union type #1426

sbc100 opened this issue Aug 8, 2024 · 4 comments

Comments

@sbc100
Copy link

sbc100 commented Aug 8, 2024

In WebAssembly we are planning on using the union of long long and bigint: WebAssembly/memory64#75

In accordance with the warning in https://webidl.spec.whatwg.org/#idl-union we are opening this issue.

I believe that our use case doesn't run into any issues because we are essentially implementing overloading based on the type of the receiver. The receiver is either a 64-bit memory/table (in which case we expect bitint indexes) or a 32-bit memory/table (in which case we expect number indexes).

@sbc100
Copy link
Author

sbc100 commented Aug 20, 2024

CC @littledan who added the wording about these union types.

@annevk
Copy link
Member

annevk commented Aug 20, 2024

I'd be curious to hear @littledan's take, but this seems reasonable to me. Thanks for filing!

@sbc100
Copy link
Author

sbc100 commented Sep 19, 2024

Closing this since we have gone ahead with this change now on the wasm side.

@sbc100 sbc100 closed this as completed Sep 19, 2024
@bvisness
Copy link

bvisness commented Oct 3, 2024

FYI, we ended up reverting this in WebAssembly/memory64#86 because the special conversion rules for a union of numeric type and bigint would, through ToNumeric/ToNumber, force all string and boolean values to be interpreted as Number instead of BigInt. This is a very confusing special case.

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

No branches or pull requests

3 participants