@@ -115,8 +115,39 @@ impl Analyzer<'_, '_> {
115
115
body,
116
116
metadata : InterfaceMetadata { common } ,
117
117
} ) => {
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
+
118
142
for extend in extends {
119
143
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();
120
151
let union_type = Type :: new_union ( * span, types) ;
121
152
if let box RExpr :: Ident ( ident) = & extend. expr {
122
153
let RIdent {
@@ -126,8 +157,16 @@ impl Analyzer<'_, '_> {
126
157
optional,
127
158
} = ident;
128
159
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
+ // })));
129
166
return Ok ( Cow :: Owned ( Type :: Array ( Array {
130
167
span : * span,
168
+ // elem_type: box Type::any(*span,
169
+ // KeywordTypeMetadata { common: *common }),
131
170
elem_type : box union_type,
132
171
metadata : Default :: default ( ) ,
133
172
} ) ) ) ;
0 commit comments