Skip to content

Commit 448594e

Browse files
committed
tweak
1 parent 3256f64 commit 448594e

File tree

8 files changed

+59
-84
lines changed

8 files changed

+59
-84
lines changed

jscomp/syntax/ast_util.ml

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ open Ast_helper
2626
type 'a cxt = Ast_helper.loc -> Bs_ast_mapper.mapper -> 'a
2727
type loc = Location.t
2828

29-
29+
type exp = Parsetree.expression
3030

3131
type label_exprs = (Longident.t Asttypes.loc * Parsetree.expression) list
3232
type uncurry_expression_gen =
@@ -58,26 +58,22 @@ let js_property loc obj (name : string) =
5858
[#=],
5959
*)
6060

61-
(*
62-
if not (Ast_compatible.is_arg_label_simple label) then
63-
Bs_syntaxerr.err loc Label_in_uncurried_bs_attribute;
64-
*)
61+
6562
let generic_apply kind loc
6663
(self : Bs_ast_mapper.mapper)
6764
(obj : Parsetree.expression)
68-
(args : Parsetree.expression list) cb =
65+
(args : Parsetree.expression list) (cb : loc -> exp-> exp) =
6966
let obj = self.expr self obj in
7067
let args =
7168
Ext_list.map args (fun e -> self.expr self e) in
72-
let len = List.length args in
73-
let arity, fn, args =
69+
let fn = cb loc obj in
70+
let args =
7471
match args with
7572
| [ {pexp_desc =
7673
Pexp_construct ({txt = Lident "()"}, None)}]
77-
->
78-
0, cb loc obj, []
79-
| _ ->
80-
len, cb loc obj, args in
74+
-> []
75+
| _ -> args in
76+
let arity = List.length args in
8177
if arity < 10 then
8278
let txt =
8379
match kind with

jscomp/test/class_type_ffi_test.ml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ let f (x : < bark : string -> unit [@bs.meth] ; fight : unit -> unit [@bs.meth]
4545
x##bark "he";
4646
x##fight ()
4747

48+
(* This type is generated on the fly -- in which case
49+
it can not be nominal
50+
*)
4851
let ff
4952
(fn :('a0 -> 'a1 -> 'a2 -> 'a3 -> 'a4 -> 'a5 -> 'a6 -> 'a7 -> 'a8 -> 'a9 -> 'a10 -> 'a11 -> 'a12 [@bs])) a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 =
5053
fn a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 [@bs]

lib/4.06.1/bsdep.ml

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -44742,7 +44742,7 @@ open Ast_helper
4474244742
type 'a cxt = Ast_helper.loc -> Bs_ast_mapper.mapper -> 'a
4474344743
type loc = Location.t
4474444744

44745-
44745+
type exp = Parsetree.expression
4474644746

4474744747
type label_exprs = (Longident.t Asttypes.loc * Parsetree.expression) list
4474844748
type uncurry_expression_gen =
@@ -44774,26 +44774,22 @@ let js_property loc obj (name : string) =
4477444774
[#=],
4477544775
*)
4477644776

44777-
(*
44778-
if not (Ast_compatible.is_arg_label_simple label) then
44779-
Bs_syntaxerr.err loc Label_in_uncurried_bs_attribute;
44780-
*)
44777+
4478144778
let generic_apply kind loc
4478244779
(self : Bs_ast_mapper.mapper)
4478344780
(obj : Parsetree.expression)
44784-
(args : Parsetree.expression list) cb =
44781+
(args : Parsetree.expression list) (cb : loc -> exp-> exp) =
4478544782
let obj = self.expr self obj in
4478644783
let args =
4478744784
Ext_list.map args (fun e -> self.expr self e) in
44788-
let len = List.length args in
44789-
let arity, fn, args =
44785+
let fn = cb loc obj in
44786+
let args =
4479044787
match args with
4479144788
| [ {pexp_desc =
4479244789
Pexp_construct ({txt = Lident "()"}, None)}]
44793-
->
44794-
0, cb loc obj, []
44795-
| _ ->
44796-
len, cb loc obj, args in
44790+
-> []
44791+
| _ -> args in
44792+
let arity = List.length args in
4479744793
if arity < 10 then
4479844794
let txt =
4479944795
match kind with

lib/4.06.1/bsppx.ml

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -302480,7 +302480,7 @@ open Ast_helper
302480302480
type 'a cxt = Ast_helper.loc -> Bs_ast_mapper.mapper -> 'a
302481302481
type loc = Location.t
302482302482

302483-
302483+
type exp = Parsetree.expression
302484302484

302485302485
type label_exprs = (Longident.t Asttypes.loc * Parsetree.expression) list
302486302486
type uncurry_expression_gen =
@@ -302512,26 +302512,22 @@ let js_property loc obj (name : string) =
302512302512
[#=],
302513302513
*)
302514302514

302515-
(*
302516-
if not (Ast_compatible.is_arg_label_simple label) then
302517-
Bs_syntaxerr.err loc Label_in_uncurried_bs_attribute;
302518-
*)
302515+
302519302516
let generic_apply kind loc
302520302517
(self : Bs_ast_mapper.mapper)
302521302518
(obj : Parsetree.expression)
302522-
(args : Parsetree.expression list) cb =
302519+
(args : Parsetree.expression list) (cb : loc -> exp-> exp) =
302523302520
let obj = self.expr self obj in
302524302521
let args =
302525302522
Ext_list.map args (fun e -> self.expr self e) in
302526-
let len = List.length args in
302527-
let arity, fn, args =
302523+
let fn = cb loc obj in
302524+
let args =
302528302525
match args with
302529302526
| [ {pexp_desc =
302530302527
Pexp_construct ({txt = Lident "()"}, None)}]
302531-
->
302532-
0, cb loc obj, []
302533-
| _ ->
302534-
len, cb loc obj, args in
302528+
-> []
302529+
| _ -> args in
302530+
let arity = List.length args in
302535302531
if arity < 10 then
302536302532
let txt =
302537302533
match kind with

lib/4.06.1/unstable/js_compiler.ml

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23027,7 +23027,7 @@ open Ast_helper
2302723027
type 'a cxt = Ast_helper.loc -> Bs_ast_mapper.mapper -> 'a
2302823028
type loc = Location.t
2302923029

23030-
23030+
type exp = Parsetree.expression
2303123031

2303223032
type label_exprs = (Longident.t Asttypes.loc * Parsetree.expression) list
2303323033
type uncurry_expression_gen =
@@ -23059,26 +23059,22 @@ let js_property loc obj (name : string) =
2305923059
[#=],
2306023060
*)
2306123061

23062-
(*
23063-
if not (Ast_compatible.is_arg_label_simple label) then
23064-
Bs_syntaxerr.err loc Label_in_uncurried_bs_attribute;
23065-
*)
23062+
2306623063
let generic_apply kind loc
2306723064
(self : Bs_ast_mapper.mapper)
2306823065
(obj : Parsetree.expression)
23069-
(args : Parsetree.expression list) cb =
23066+
(args : Parsetree.expression list) (cb : loc -> exp-> exp) =
2307023067
let obj = self.expr self obj in
2307123068
let args =
2307223069
Ext_list.map args (fun e -> self.expr self e) in
23073-
let len = List.length args in
23074-
let arity, fn, args =
23070+
let fn = cb loc obj in
23071+
let args =
2307523072
match args with
2307623073
| [ {pexp_desc =
2307723074
Pexp_construct ({txt = Lident "()"}, None)}]
23078-
->
23079-
0, cb loc obj, []
23080-
| _ ->
23081-
len, cb loc obj, args in
23075+
-> []
23076+
| _ -> args in
23077+
let arity = List.length args in
2308223078
if arity < 10 then
2308323079
let txt =
2308423080
match kind with

lib/4.06.1/unstable/js_refmt_compiler.ml

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -302133,7 +302133,7 @@ open Ast_helper
302133302133
type 'a cxt = Ast_helper.loc -> Bs_ast_mapper.mapper -> 'a
302134302134
type loc = Location.t
302135302135

302136-
302136+
type exp = Parsetree.expression
302137302137

302138302138
type label_exprs = (Longident.t Asttypes.loc * Parsetree.expression) list
302139302139
type uncurry_expression_gen =
@@ -302165,26 +302165,22 @@ let js_property loc obj (name : string) =
302165302165
[#=],
302166302166
*)
302167302167

302168-
(*
302169-
if not (Ast_compatible.is_arg_label_simple label) then
302170-
Bs_syntaxerr.err loc Label_in_uncurried_bs_attribute;
302171-
*)
302168+
302172302169
let generic_apply kind loc
302173302170
(self : Bs_ast_mapper.mapper)
302174302171
(obj : Parsetree.expression)
302175-
(args : Parsetree.expression list) cb =
302172+
(args : Parsetree.expression list) (cb : loc -> exp-> exp) =
302176302173
let obj = self.expr self obj in
302177302174
let args =
302178302175
Ext_list.map args (fun e -> self.expr self e) in
302179-
let len = List.length args in
302180-
let arity, fn, args =
302176+
let fn = cb loc obj in
302177+
let args =
302181302178
match args with
302182302179
| [ {pexp_desc =
302183302180
Pexp_construct ({txt = Lident "()"}, None)}]
302184-
->
302185-
0, cb loc obj, []
302186-
| _ ->
302187-
len, cb loc obj, args in
302181+
-> []
302182+
| _ -> args in
302183+
let arity = List.length args in
302188302184
if arity < 10 then
302189302185
let txt =
302190302186
match kind with

lib/4.06.1/unstable/native_ppx.ml

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21360,7 +21360,7 @@ open Ast_helper
2136021360
type 'a cxt = Ast_helper.loc -> Bs_ast_mapper.mapper -> 'a
2136121361
type loc = Location.t
2136221362

21363-
21363+
type exp = Parsetree.expression
2136421364

2136521365
type label_exprs = (Longident.t Asttypes.loc * Parsetree.expression) list
2136621366
type uncurry_expression_gen =
@@ -21392,26 +21392,22 @@ let js_property loc obj (name : string) =
2139221392
[#=],
2139321393
*)
2139421394

21395-
(*
21396-
if not (Ast_compatible.is_arg_label_simple label) then
21397-
Bs_syntaxerr.err loc Label_in_uncurried_bs_attribute;
21398-
*)
21395+
2139921396
let generic_apply kind loc
2140021397
(self : Bs_ast_mapper.mapper)
2140121398
(obj : Parsetree.expression)
21402-
(args : Parsetree.expression list) cb =
21399+
(args : Parsetree.expression list) (cb : loc -> exp-> exp) =
2140321400
let obj = self.expr self obj in
2140421401
let args =
2140521402
Ext_list.map args (fun e -> self.expr self e) in
21406-
let len = List.length args in
21407-
let arity, fn, args =
21403+
let fn = cb loc obj in
21404+
let args =
2140821405
match args with
2140921406
| [ {pexp_desc =
2141021407
Pexp_construct ({txt = Lident "()"}, None)}]
21411-
->
21412-
0, cb loc obj, []
21413-
| _ ->
21414-
len, cb loc obj, args in
21408+
-> []
21409+
| _ -> args in
21410+
let arity = List.length args in
2141521411
if arity < 10 then
2141621412
let txt =
2141721413
match kind with

lib/4.06.1/whole_compiler.ml

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -410128,7 +410128,7 @@ open Ast_helper
410128410128
type 'a cxt = Ast_helper.loc -> Bs_ast_mapper.mapper -> 'a
410129410129
type loc = Location.t
410130410130

410131-
410131+
type exp = Parsetree.expression
410132410132

410133410133
type label_exprs = (Longident.t Asttypes.loc * Parsetree.expression) list
410134410134
type uncurry_expression_gen =
@@ -410160,26 +410160,22 @@ let js_property loc obj (name : string) =
410160410160
[#=],
410161410161
*)
410162410162

410163-
(*
410164-
if not (Ast_compatible.is_arg_label_simple label) then
410165-
Bs_syntaxerr.err loc Label_in_uncurried_bs_attribute;
410166-
*)
410163+
410167410164
let generic_apply kind loc
410168410165
(self : Bs_ast_mapper.mapper)
410169410166
(obj : Parsetree.expression)
410170-
(args : Parsetree.expression list) cb =
410167+
(args : Parsetree.expression list) (cb : loc -> exp-> exp) =
410171410168
let obj = self.expr self obj in
410172410169
let args =
410173410170
Ext_list.map args (fun e -> self.expr self e) in
410174-
let len = List.length args in
410175-
let arity, fn, args =
410171+
let fn = cb loc obj in
410172+
let args =
410176410173
match args with
410177410174
| [ {pexp_desc =
410178410175
Pexp_construct ({txt = Lident "()"}, None)}]
410179-
->
410180-
0, cb loc obj, []
410181-
| _ ->
410182-
len, cb loc obj, args in
410176+
-> []
410177+
| _ -> args in
410178+
let arity = List.length args in
410183410179
if arity < 10 then
410184410180
let txt =
410185410181
match kind with

0 commit comments

Comments
 (0)