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

Respect #[repr(transparent)] #1474

Open
RReverser opened this issue Apr 18, 2019 · 1 comment · May be fixed by #2751
Open

Respect #[repr(transparent)] #1474

RReverser opened this issue Apr 18, 2019 · 1 comment · May be fixed by #2751
Labels

Comments

@RReverser
Copy link
Member

Describe the Bug

I'm not 100% sure whether this is a bug or a feature request, but, in theory, wasm-bindgen ABI can be seen as any other, and so repr(...) should have an effect.

Steps to Reproduce

  1. Define a struct with a single field (or a single field and a zero-size type like PhantomData).
  2. Add #[repr(transparent)] to signify that its ABI should be the same as the inner field.
  3. Add #[wasm_bindgen] attribute to export struct to JS.

Expected Behavior

Struct is represented on the JS side as a type alias to the inner field.

Actual Behavior

A wrapper class is generated.

@RReverser RReverser added the bug label Apr 18, 2019
@nasso
Copy link
Contributor

nasso commented Dec 28, 2021

I'd like to work on that one :)

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

Successfully merging a pull request may close this issue.

2 participants