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

Cannot import statics with the same name from different snippets. #3878

Open
zopsicle opened this issue Mar 9, 2024 · 0 comments
Open

Cannot import statics with the same name from different snippets. #3878

zopsicle opened this issue Mar 9, 2024 · 0 comments
Labels

Comments

@zopsicle
Copy link

zopsicle commented Mar 9, 2024

Describe the Bug

Cannot import statics with the same name from different snippets.

Steps to Reproduce

mod a
{
    use super::*;

    #[wasm_bindgen(inline_js = r#"export const X = 1;"#)]
    extern
    {
        pub static X: JsValue;
    }
}

mod b
{
    use super::*;

    #[wasm_bindgen(inline_js = r#"export const X = 2;"#)]
    extern
    {
        pub static X: JsValue;
    }
}

#[wasm_bindgen(inline_js = r#"export function f(a, b) { console.log(a, b); }"#)]
extern
{
    fn f(a: &JsValue, b: &JsValue);
}

#[wasm_bindgen(start)]
pub fn g()
{
    f(&a::X, &b::X)
}

Expected Behavior

Output is [1, 2].

Actual Behavior

Output is [1, 1].

Additional Context

Using wasm-bindgen 0.2.92.

@zopsicle zopsicle added the bug label Mar 9, 2024
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