File tree Expand file tree Collapse file tree 7 files changed +713
-725
lines changed Expand file tree Collapse file tree 7 files changed +713
-725
lines changed Original file line number Diff line number Diff line change @@ -61,6 +61,5 @@ let to_uncurry_type loc (mapper : Bs_ast_mapper.mapper)
61
61
let fn_type = Typ. arrow ~loc label first_arg typ in
62
62
let arity = Ast_core_type. get_uncurry_arity fn_type in
63
63
match arity with
64
- | Some 0 -> Ast_uncurried. uncurriedType ~loc ~arity: 0 typ
65
64
| Some arity -> Ast_uncurried. uncurriedType ~loc ~arity fn_type
66
65
| None -> assert false
Original file line number Diff line number Diff line change 1
1
(* Untyped AST *)
2
2
3
- let new_representation arity = arity = 5
3
+ let new_representation arity = arity = 0 || arity = 5
4
4
5
5
let arityType ~loc arity =
6
6
Ast_helper.Typ. variant ~loc
Original file line number Diff line number Diff line change 74
74
type 'a t = < .. > as 'a
75
75
(* * JS object type *)
76
76
77
- type ('fn, 'arity) uncurried = Uncurried of 'fn [@ unboxed]
78
-
79
77
(* */**)
80
78
81
79
(* internal types for FFI, these types are not used by normal users
82
80
Absent cmi file when looking up module alias.
83
81
*)
84
82
85
83
module Fn = struct
86
- type 'a arity0 = { i0 : unit -> 'a [@ internal] }
87
84
type 'a arity1 = { i1 : 'a [@ internal] }
88
85
type 'a arity2 = { i2 : 'a [@ internal] }
89
86
type 'a arity3 = { i3 : 'a [@ internal] }
@@ -113,12 +110,10 @@ end
113
110
module MapperRt = Js_mapperRt
114
111
115
112
module Internal = struct
116
- open Fn
117
-
118
113
external opaqueFullApply : 'a -> 'a = " %uncurried_apply"
119
114
120
115
(* Use opaque instead of [._n] to prevent some optimizations happening *)
121
- external run : 'a arity0 -> 'a = " #run"
116
+ external run : ( unit -> 'a [ @ bs]) -> 'a = " #run"
122
117
external opaque : 'a -> 'a = " %opaque"
123
118
end
124
119
Original file line number Diff line number Diff line change 46
46
type 'a t = < .. > as 'a
47
47
(* */**)
48
48
49
- type ('fn, 'arity) uncurried = Uncurried of 'fn [@ unboxed]
50
-
51
49
(* internal types for FFI, these types are not used by normal users
52
50
Absent cmi file when looking up module alias.
53
51
*)
54
52
module Fn = struct
55
- type 'a arity0 = {
56
- i0 : unit -> 'a [@ internal]
57
- }
58
53
type 'a arity1 = {
59
54
i1 : 'a [@ internal]
60
55
}
@@ -126,11 +121,10 @@ end
126
121
(* */**)
127
122
module MapperRt = Js_mapperRt
128
123
module Internal = struct
129
- open Fn
130
124
external opaqueFullApply : 'a -> 'a = " %uncurried_apply"
131
125
132
126
(* Use opaque instead of [._n] to prevent some optimizations happening *)
133
- external run : 'a arity0 -> 'a = " #run"
127
+ external run : ( unit -> 'a [ @ bs]) -> 'a = " #run"
134
128
external opaque : 'a -> 'a = " %opaque"
135
129
136
130
end
You can’t perform that action at this time.
0 commit comments