Skip to content

Commit 568a0fb

Browse files
committed
Remove array converter
1 parent 22a4ba5 commit 568a0fb

File tree

1 file changed

+4
-13
lines changed

1 file changed

+4
-13
lines changed

jscomp/gentype/Converter.ml

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
open GenTypeCommon
22

33
type t =
4-
| ArrayC of t
54
| CircularC of string * t
65
| FunctionC of functionC
76
| IdentC
@@ -24,7 +23,6 @@ and functionC = {
2423

2524
let rec toString converter =
2625
match converter with
27-
| ArrayC c -> "array(" ^ toString c ^ ")"
2826
| CircularC (s, c) -> "circular(" ^ s ^ " " ^ toString c ^ ")"
2927
| FunctionC {funArgConverters; retConverter; uncurried} ->
3028
"fn"
@@ -62,8 +60,8 @@ let typeGetConverterNormalized ~config ~inline ~lookupId ~typeNameIsInterface
6260
let normalized_ = type_ in
6361
match type_ with
6462
| 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_))
6765
| Dict _ -> (IdentC, normalized_)
6866
| Function
6967
({argTypes; componentName; retType; typeVars; uncurried} as function_)
@@ -216,7 +214,6 @@ let typeGetNormalized ~config ~inline ~lookupId ~typeNameIsInterface type_ =
216214

217215
let rec converterIsIdentity ~config ~toJS converter =
218216
match converter with
219-
| ArrayC c -> c |> converterIsIdentity ~config ~toJS
220217
| CircularC (_, c) -> c |> converterIsIdentity ~config ~toJS
221218
| FunctionC {funArgConverters; retConverter; uncurried} ->
222219
retConverter |> converterIsIdentity ~config ~toJS
@@ -233,16 +230,10 @@ let rec converterIsIdentity ~config ~toJS converter =
233230
| TupleC innerTypesC ->
234231
innerTypesC |> List.for_all (converterIsIdentity ~config ~toJS)
235232

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 =
237235
match converter with
238236
| _ when converter |> converterIsIdentity ~config ~toJS -> value
239-
| ArrayC c ->
240-
let x = "ArrayItem" |> EmitText.name ~nameGen in
241-
value ^ ".map(function _element("
242-
^ (x |> EmitType.ofTypeAny ~config)
243-
^ ") { return "
244-
^ (x |> apply ~config ~converter:c ~indent ~nameGen ~toJS ~variantTables)
245-
^ "})"
246237
| CircularC (s, c) ->
247238
value
248239
|> EmitText.addComment

0 commit comments

Comments
 (0)