Skip to content

Enum type exported to TypeScript, but not used in params #3505

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

Closed
benma opened this issue Jul 5, 2023 · 2 comments
Closed

Enum type exported to TypeScript, but not used in params #3505

benma opened this issue Jul 5, 2023 · 2 comments
Labels

Comments

@benma
Copy link

benma commented Jul 5, 2023

Describe the Bug

#[wasm_bindgen]
pub enum Foo {
    A = 1,
    B = 2,
}

#[wasm_bindgen]
pub async fn foo(foo: Foo) -> Result<(), ()> {
   // ... 
}

Produces this TypeScript:

export enum Foo {
  A = 1,
  B = 2,
}
export function foo(foo: number): void

Expected Behavior

I expected the function to be exported as:

export function foo(foo: Foo): void
@benma benma added the bug label Jul 5, 2023
@Stefan-Hanke
Copy link
Contributor

Looks like a duplicate to #2154

@daxpedda
Copy link
Collaborator

daxpedda commented Jul 6, 2023

Duplicate of #2154.

@daxpedda daxpedda closed this as completed Jul 6, 2023
@daxpedda daxpedda closed this as not planned Won't fix, can't repro, duplicate, stale Jul 6, 2023
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