mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-06-12 20:41:24 +00:00
Fix the constructor
and catch
attributes combined
This commit fixes annotations that include both the `constructor` and `catch` attributes on imported types, ensuring that we infer the right type being returned after extracting the first type parameter of the `Result`. Closes #735
This commit is contained in:
@ -486,7 +486,7 @@ impl<'a> ConvertToAst<(BindgenAttrs, &'a Option<String>)> for syn::ForeignItemFn
|
||||
|
||||
ast::ImportFunctionKind::Method { class, ty, kind }
|
||||
} else if opts.constructor() {
|
||||
let class = match wasm.ret {
|
||||
let class = match js_ret {
|
||||
Some(ref ty) => ty,
|
||||
_ => bail_span!(self, "constructor returns must be bare types"),
|
||||
};
|
||||
|
Reference in New Issue
Block a user