@@ -414,7 +414,7 @@ impl<'a> ConvertToAst<(BindgenAttrs, &'a ast::ImportModule)> for syn::ForeignIte
414
414
let class = wasm. arguments . get ( 0 ) . ok_or_else ( || {
415
415
err_span ! ( self , "imported methods must have at least one argument" )
416
416
} ) ?;
417
- let class = match & * class. ty {
417
+ let mut class = match & * class. ty {
418
418
syn:: Type :: Reference ( syn:: TypeReference {
419
419
mutability : None ,
420
420
elem,
@@ -425,6 +425,9 @@ impl<'a> ConvertToAst<(BindgenAttrs, &'a ast::ImportModule)> for syn::ForeignIte
425
425
"first argument of method must be a shared reference"
426
426
) ,
427
427
} ;
428
+ if let syn:: Type :: Group ( syn:: TypeGroup { elem, .. } ) = class {
429
+ class = elem;
430
+ }
428
431
let class_name = match * class {
429
432
syn:: Type :: Path ( syn:: TypePath {
430
433
qself : None ,
@@ -462,10 +465,13 @@ impl<'a> ConvertToAst<(BindgenAttrs, &'a ast::ImportModule)> for syn::ForeignIte
462
465
463
466
ast:: ImportFunctionKind :: Method { class, ty, kind }
464
467
} else if opts. constructor ( ) . is_some ( ) {
465
- let class = match js_ret {
468
+ let mut class = match js_ret {
466
469
Some ( ref ty) => ty,
467
470
_ => bail_span ! ( self , "constructor returns must be bare types" ) ,
468
471
} ;
472
+ if let syn:: Type :: Group ( syn:: TypeGroup { elem, .. } ) = class {
473
+ class = elem;
474
+ }
469
475
let class_name = match * class {
470
476
syn:: Type :: Path ( syn:: TypePath {
471
477
qself : None ,
0 commit comments