@@ -414,7 +414,7 @@ impl<'a> ConvertToAst<(BindgenAttrs, &'a ast::ImportModule)> for syn::ForeignIte
414414 let class = wasm. arguments . get ( 0 ) . ok_or_else ( || {
415415 err_span ! ( self , "imported methods must have at least one argument" )
416416 } ) ?;
417- let class = match & * class. ty {
417+ let mut class = match & * class. ty {
418418 syn:: Type :: Reference ( syn:: TypeReference {
419419 mutability : None ,
420420 elem,
@@ -425,6 +425,9 @@ impl<'a> ConvertToAst<(BindgenAttrs, &'a ast::ImportModule)> for syn::ForeignIte
425425 "first argument of method must be a shared reference"
426426 ) ,
427427 } ;
428+ if let syn:: Type :: Group ( syn:: TypeGroup { elem, .. } ) = class {
429+ class = elem;
430+ }
428431 let class_name = match * class {
429432 syn:: Type :: Path ( syn:: TypePath {
430433 qself : None ,
@@ -462,10 +465,13 @@ impl<'a> ConvertToAst<(BindgenAttrs, &'a ast::ImportModule)> for syn::ForeignIte
462465
463466 ast:: ImportFunctionKind :: Method { class, ty, kind }
464467 } else if opts. constructor ( ) . is_some ( ) {
465- let class = match js_ret {
468+ let mut class = match js_ret {
466469 Some ( ref ty) => ty,
467470 _ => bail_span ! ( self , "constructor returns must be bare types" ) ,
468471 } ;
472+ if let syn:: Type :: Group ( syn:: TypeGroup { elem, .. } ) = class {
473+ class = elem;
474+ }
469475 let class_name = match * class {
470476 syn:: Type :: Path ( syn:: TypePath {
471477 qself : None ,
0 commit comments