File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -549,7 +549,12 @@ impl<'a> IdlType<'a> {
549
549
} ,
550
550
IdlType :: Enum ( name) => Some ( ident_ty ( rust_ident ( camel_case_ident ( name) . as_str ( ) ) ) ) ,
551
551
552
- IdlType :: Nullable ( idl_type) => Some ( option_ty ( idl_type. to_syn_type ( pos) ?) ) ,
552
+ IdlType :: Nullable ( idl_type) => {
553
+ match * * idl_type {
554
+ IdlType :: Union ( ..) => idl_type. to_syn_type ( pos) ,
555
+ _ => Some ( option_ty ( idl_type. to_syn_type ( pos) ?) )
556
+ }
557
+ } ,
553
558
IdlType :: FrozenArray ( _idl_type) => None ,
554
559
IdlType :: Sequence ( _idl_type) => None ,
555
560
IdlType :: Promise ( _idl_type) => {
@@ -563,10 +568,10 @@ impl<'a> IdlType<'a> {
563
568
}
564
569
IdlType :: Record ( _idl_type_from, _idl_type_to) => None ,
565
570
IdlType :: Union ( _idl_types) => {
566
- // Handles union types in all places except operation argument types
571
+ // Handles union types in all places except operation argument types.
572
+ // Currently treats them as any type.
567
573
// TODO: add better support for union types here?
568
- let path = vec ! [ rust_ident( "wasm_bindgen" ) , rust_ident( "JsValue" ) ] ;
569
- Some ( leading_colon_path_ty ( path) )
574
+ IdlType :: Any . to_syn_type ( pos)
570
575
} ,
571
576
572
577
IdlType :: Any => {
You can’t perform that action at this time.
0 commit comments