@@ -115,8 +115,39 @@ impl Analyzer<'_, '_> {
115115 body,
116116 metadata : InterfaceMetadata { common } ,
117117 } ) => {
118+ // for extend in extends {
119+ // for type_arg in extend.to_owned().type_args {
120+ // for param in type_arg.params {
121+ // match param {
122+ // Type::Array(_) => return Ok(Cow::Owned(param)),
123+ // Type::Union(Union { span, types, metadata }) => {
124+ // for ty in types {
125+ // match ty {
126+ // Type::Array(_) => {
127+ // println!("{ty:#?}");
128+ // return Ok(Cow::Owned(ty));
129+ // }
130+ // _ => {
131+ // // println!("{ty:#?}");
132+ // }
133+ // }
134+ // }
135+ // }
136+ // _ => {}
137+ // }
138+ // }
139+ // }
140+ // }
141+
118142 for extend in extends {
119143 let types = extend. to_owned ( ) . type_args . into_iter ( ) . flat_map ( |cur| cur. params ) ;
144+ // let elems = types
145+ // .map(|ty| TupleElement {
146+ // span: *span,
147+ // label: None,
148+ // ty: box ty,
149+ // })
150+ // .collect();
120151 let union_type = Type :: new_union ( * span, types) ;
121152 if let box RExpr :: Ident ( ident) = & extend. expr {
122153 let RIdent {
@@ -126,8 +157,16 @@ impl Analyzer<'_, '_> {
126157 optional,
127158 } = ident;
128159 if sym == & js_word ! ( "Array" ) {
160+ // println!("{span:#?}\n{union_type:#?}");
161+ // return Ok(Cow::Owned(Type::Tuple(Tuple {
162+ // span: *span,
163+ // elems,
164+ // metadata: TupleMetadata { common: *common },
165+ // })));
129166 return Ok ( Cow :: Owned ( Type :: Array ( Array {
130167 span : * span,
168+ // elem_type: box Type::any(*span,
169+ // KeywordTypeMetadata { common: *common }),
131170 elem_type : box union_type,
132171 metadata : Default :: default ( ) ,
133172 } ) ) ) ;
0 commit comments