1
1
open GenTypeCommon
2
2
3
3
type t =
4
- | ArrayC of t
5
4
| CircularC of string * t
6
5
| FunctionC of functionC
7
6
| IdentC
@@ -24,7 +23,6 @@ and functionC = {
24
23
25
24
let rec toString converter =
26
25
match converter with
27
- | ArrayC c -> " array(" ^ toString c ^ " )"
28
26
| CircularC (s , c ) -> " circular(" ^ s ^ " " ^ toString c ^ " )"
29
27
| FunctionC {funArgConverters; retConverter; uncurried} ->
30
28
" fn"
@@ -62,8 +60,8 @@ let typeGetConverterNormalized ~config ~inline ~lookupId ~typeNameIsInterface
62
60
let normalized_ = type_ in
63
61
match type_ with
64
62
| Array (t , mutable_ ) ->
65
- let tConverter , tNormalized = t |> visit ~visited in
66
- (ArrayC tConverter , Array (tNormalized, mutable_))
63
+ let _ , tNormalized = t |> visit ~visited in
64
+ (IdentC , Array (tNormalized, mutable_))
67
65
| Dict _ -> (IdentC , normalized_)
68
66
| Function
69
67
({argTypes; componentName; retType; typeVars; uncurried} as function_)
@@ -216,7 +214,6 @@ let typeGetNormalized ~config ~inline ~lookupId ~typeNameIsInterface type_ =
216
214
217
215
let rec converterIsIdentity ~config ~toJS converter =
218
216
match converter with
219
- | ArrayC c -> c |> converterIsIdentity ~config ~to JS
220
217
| CircularC (_ , c ) -> c |> converterIsIdentity ~config ~to JS
221
218
| FunctionC {funArgConverters; retConverter; uncurried} ->
222
219
retConverter |> converterIsIdentity ~config ~to JS
@@ -233,16 +230,10 @@ let rec converterIsIdentity ~config ~toJS converter =
233
230
| TupleC innerTypesC ->
234
231
innerTypesC |> List. for_all (converterIsIdentity ~config ~to JS)
235
232
236
- let rec apply ~config ~converter ~indent ~nameGen ~toJS ~variantTables value =
233
+ let rec apply ~(config : Config.t ) ~converter ~indent ~nameGen ~toJS
234
+ ~variantTables value =
237
235
match converter with
238
236
| _ when converter |> converterIsIdentity ~config ~to JS -> value
239
- | ArrayC c ->
240
- let x = " ArrayItem" |> EmitText. name ~name Gen in
241
- value ^ " .map(function _element("
242
- ^ (x |> EmitType. ofTypeAny ~config )
243
- ^ " ) { return "
244
- ^ (x |> apply ~config ~converter: c ~indent ~name Gen ~to JS ~variant Tables)
245
- ^ " })"
246
237
| CircularC (s , c ) ->
247
238
value
248
239
|> EmitText. addComment
0 commit comments