Closed
Description
Describe the Bug
wasm_bindgen allows you to create an async constructor even though this is not supported by typescript.
Steps to Reproduce
#[wasm_bindgen]
pub struct MyStruct {
data: u32
}
#[wasm_bindgen]
impl MyStruct {
#[wasm_bindgen(constructor)]
pub async fn new(data: u32) -> Self {
// do something async
Self { data }
}
}
This compiles and actually works, however seems like undefined behavior and should just fail to compile
Expected Behavior
Unknown, probably fail to compile
Actual Behavior
Works