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

Public fields and getters / setter attributes that have the same name generate duplicate JS methods #1500

Closed
c410-f3r opened this issue May 1, 2019 · 1 comment
Labels

Comments

@c410-f3r
Copy link
Contributor

c410-f3r commented May 1, 2019

Describe the Bug

Public fields and getters / setter attributes that have the same name generate duplicate JS definitions.

Steps to Reproduce

#[wasm_bindgen]
pub struct Struct {
    pub field: i32,
}

#[wasm_bindgen]
impl Struct {
    #[wasm_bindgen(getter)]
    pub fn field(&self) -> i32 {
        self.field
    }

    #[wasm_bindgen(setter)]
    pub fn set_field(&mut self, field: i32) {
        self.field = field;
    }
}

Expected Behavior

An error forbidden the duplicated behavior

Actual Behavior

Duplicated getters and setters.

get field() {
    ...
}
set field(arg0) {
    ...
}

get field() {
    ...
}
set field(field) {
    ...
}
@c410-f3r c410-f3r added the bug label May 1, 2019
@c410-f3r c410-f3r changed the title Public fields and getters / setter attributes that have the same name generate duplicate JS definitions. Public fields and getters / setter attributes that have the same name generate duplicate JS methods May 1, 2019
@c410-f3r
Copy link
Contributor Author

c410-f3r commented Jun 19, 2019

Fixed in #1605

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

1 participant