Description
Describe the Bug
In version 0.2.95, any function returning a Result<T,E>
will cause the generated typescript function to return Array
(note that it's not Array<T>
, just Array
). The problem doesn't occur in version 0.2.93.
Steps to Reproduce
Using the code from wasm-bindgen
doc
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
pub fn throwing_function() -> Result<(), JsError> {
Err(JsError::new("message"))
}
Expected Behavior
in version 0.2.93, the generated function signature in typescript would be
export function throwing_function(a: number): void;
Actual Behavior
but in 0.2.95, it becomes.
export function throwing_function(): Array;
Additional Context
The problem doesn't seem to be JsError
itself, I originally run into the problem while using serde-wasm-bindgen
and the function returns Result<i32,JsValue>
. The generated ts function also returns Array
as output.