Skip to content

Commit 023e59b

Browse files
committed
more dce
1 parent 9e36cce commit 023e59b

File tree

3 files changed

+4
-22
lines changed

3 files changed

+4
-22
lines changed

jscomp/gentype/GenTypeCommon.ml

+1-6
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,7 @@ and field = {
8080
type_: type_;
8181
}
8282

83-
and function_ = {
84-
argTypes: argType list;
85-
retType: type_;
86-
typeVars: string list;
87-
uncurried: bool; [@live]
88-
}
83+
and function_ = {argTypes: argType list; retType: type_; typeVars: string list}
8984

9085
and ident = {builtin: bool; name: string; typeArgs: type_ list}
9186

jscomp/gentype/TranslateCoreType.ml

+1-3
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,7 @@ let rec translateArrowType ~config ~typeVarsGen ~noFunctionReturnDependencies
106106
in
107107
let labeledConvertableTypes = revArgs |> List.rev in
108108
let argTypes = labeledConvertableTypes |> NamedArgs.group in
109-
let functionType =
110-
Function {argTypes; retType; typeVars = []; uncurried = false}
111-
in
109+
let functionType = Function {argTypes; retType; typeVars = []} in
112110
{dependencies = allDeps; type_ = functionType}
113111

114112
and translateCoreType_ ~config ~typeVarsGen

jscomp/gentype/TranslateTypeExprFromTypes.ml

+2-13
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,6 @@ let translateConstr ~config ~paramsTranslation ~(path : Path.t) ~typeEnv =
163163
argTypes = [{aName = ""; aType = fromTranslation.type_}];
164164
retType = toTranslation.type_;
165165
typeVars = [];
166-
uncurried = false;
167166
};
168167
}
169168
| ( (["React"; "componentLike"] | ["ReactV3"; "React"; "componentLike"]),
@@ -176,7 +175,6 @@ let translateConstr ~config ~paramsTranslation ~(path : Path.t) ~typeEnv =
176175
argTypes = [{aName = ""; aType = propsTranslation.type_}];
177176
retType = retTranslation.type_;
178177
typeVars = [];
179-
uncurried = false;
180178
};
181179
}
182180
| ( (["React"; "component"] | ["ReactV3"; "React"; "component"]),
@@ -189,7 +187,6 @@ let translateConstr ~config ~paramsTranslation ~(path : Path.t) ~typeEnv =
189187
argTypes = [{aName = ""; aType = propsTranslation.type_}];
190188
retType = EmitType.typeReactElement;
191189
typeVars = [];
192-
uncurried = false;
193190
};
194191
}
195192
| ( (["React"; "Context"; "t"] | ["ReactV3"; "React"; "Context"; "t"]),
@@ -243,13 +240,7 @@ let translateConstr ~config ~paramsTranslation ~(path : Path.t) ~typeEnv =
243240
| (["Js"; "Dict"; "t"] | ["Dict"; "t"]), [paramTranslation] ->
244241
{paramTranslation with type_ = Dict paramTranslation.type_}
245242
| ["function$"], [arg; _arity] ->
246-
{
247-
dependencies = arg.dependencies;
248-
type_ =
249-
(match arg.type_ with
250-
| Function function_ -> Function {function_ with uncurried = true}
251-
| _ -> arg.type_);
252-
}
243+
{dependencies = arg.dependencies; type_ = arg.type_}
253244
| _ -> defaultCase ()
254245

255246
type processVariant = {
@@ -324,9 +315,7 @@ let rec translateArrowType ~config ~typeVarsGen ~typeEnv ~revArgDeps ~revArgs
324315
let allDeps = List.rev_append revArgDeps dependencies in
325316
let labeledConvertableTypes = revArgs |> List.rev in
326317
let argTypes = labeledConvertableTypes |> NamedArgs.group in
327-
let functionType =
328-
Function {argTypes; retType; typeVars = []; uncurried = false}
329-
in
318+
let functionType = Function {argTypes; retType; typeVars = []} in
330319
{dependencies = allDeps; type_ = functionType}
331320

332321
and translateTypeExprFromTypes_ ~config ~typeVarsGen ~typeEnv

0 commit comments

Comments
 (0)