Skip to content

Commit a969187

Browse files
committed
not carrying cst in Empty which is reduandant
1 parent 8e94b30 commit a969187

File tree

5 files changed

+20
-18
lines changed

5 files changed

+20
-18
lines changed

jscomp/core/lam_compile_external_call.ml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ let ocaml_to_js_eff
101101
Js_of_lam_option.get_default_undefined_from_optional raw_arg
102102
| Label | Empty -> raw_arg
103103
| LabelCst _
104-
| EmptyCst _
104+
| EmptyCst
105105
-> assert false in
106106
match arg_type with
107107
| Arg_cst _ -> assert false
@@ -176,7 +176,7 @@ let assemble_args_no_splice call_loc ffi
176176
match labels, args with
177177
| [], _
178178
-> assert (args = []) ; empty_pair
179-
| { arg_label = EmptyCst cst ; _} :: labels, args
179+
| { arg_label = EmptyCst ; arg_type = Arg_cst cst } :: labels, args
180180
| { arg_label = LabelCst {cst ;}; _} :: labels, args ->
181181
let accs, eff = aux labels args in
182182
Lam_compile_const.translate_arg_cst cst :: accs, eff
@@ -189,6 +189,7 @@ let assemble_args_no_splice call_loc ffi
189189
append_list acc accs, Ext_list.append new_eff eff
190190
| { arg_label = Empty | Label | Optional ; _ } :: _ , []
191191
-> assert false
192+
| {arg_label = EmptyCst ; _} :: _, _ -> assert false
192193
in
193194
let args, eff = aux arg_types args in
194195
args,
@@ -203,7 +204,7 @@ let assemble_args_has_splice call_loc ffi (arg_types : specs) (args : exprs)
203204
let rec aux (labels : specs) (args : exprs) =
204205
match labels, args with
205206
| [] , _ -> assert (args = []); empty_pair
206-
| { arg_label = EmptyCst cst ; _} :: labels , args
207+
| { arg_label = EmptyCst ; arg_type = Arg_cst cst} :: labels , args
207208
| { arg_label = LabelCst {cst}; _} :: labels , args ->
208209
let accs, eff = aux labels args in
209210
Lam_compile_const.translate_arg_cst cst :: accs, eff
@@ -221,6 +222,7 @@ let assemble_args_has_splice call_loc ffi (arg_types : specs) (args : exprs)
221222
end
222223
| { arg_label = Empty | Label | Optional ; _ } :: _ , []
223224
-> assert false
225+
| {arg_label = EmptyCst ;_ } :: _, _ -> assert false
224226
in
225227
let args, eff = aux arg_types args in
226228
args,

jscomp/main/builtin_cmi_datasets.ml

Lines changed: 11 additions & 11 deletions
Large diffs are not rendered by default.

jscomp/syntax/ast_external_process.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -914,8 +914,8 @@ let handle_attributes
914914
end
915915
| Nolabel ->
916916
begin match refine_arg_type ~nolabel:true ty with
917-
| new_ty , (Arg_cst i as arg_type) ->
918-
EmptyCst i , arg_type, arg_types
917+
| new_ty , (Arg_cst _ as arg_type) ->
918+
EmptyCst , arg_type, arg_types
919919
| new_ty , arg_type ->
920920
Empty, arg_type, {param_type with ty = new_ty} :: arg_types
921921
end

jscomp/syntax/external_arg_spec.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ type label_noname =
3737
| Label
3838
| LabelCst of { cst : cst }
3939
| Empty
40-
| EmptyCst of cst
40+
| EmptyCst
4141
| Optional
4242

4343
type label =

jscomp/syntax/external_arg_spec.mli

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ type label_noname =
5555
| Label
5656
| LabelCst of { cst : cst }
5757
| Empty
58-
| EmptyCst of cst
58+
| EmptyCst
5959
| Optional
6060

6161
type t =

0 commit comments

Comments
 (0)