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

Add .into() to the generated code for async fns #3919

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

MOZGIII
Copy link

@MOZGIII MOZGIII commented Apr 10, 2024

Without this I am getting an error for declarations like these:

    #[wasm_bindgen(method, getter)]
    pub async fn closed(this: &WebTransport) -> WebTransportCloseInfo;
    #[wasm_bindgen(method, getter, catch)]
    pub async fn closed(this: &WebTransport) -> Result<WebTransportCloseInfo, JsValue>;

I have tried to also create a test for this to catch regressions, but was unable to figure out where to put it.

Test

use wasm_bindgen::prelude::*;

#[wasm_bindgen]
extern "C" {
    #[wasm_bindgen]
    #[derive(Debug, Clone)]
    pub type WebTransportCloseInfo;
}

#[wasm_bindgen]
extern "C" {
    #[wasm_bindgen]
    #[derive(Debug, Clone)]
    pub type WebTransport;

    #[wasm_bindgen(method, getter, catch)]
    pub async fn closed(this: &WebTransport) -> Result<WebTransportCloseInfo, JsValue>;
}

@MOZGIII MOZGIII changed the title Add into to the generated code for async fns Add .into() to the generated code for async fns Apr 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant