Skip to content

Commit 1171f4c

Browse files
committed
duplicate definition of Nullable.t in more places as needed
1 parent 0d3c199 commit 1171f4c

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

jscomp/others/js_null_undefined.ml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,12 @@
2424

2525
(** Contains functionality for dealing with values that can be both `null` and `undefined` *)
2626

27-
type + 'a t = 'a Js.nullable
27+
type + 'a t = 'a Js.nullable =
28+
| Present of 'a
29+
| Null [@as null]
30+
| Undefined [@as undefined]
31+
[@@unboxed]
32+
2833
external toOption : 'a t -> 'a option = "#nullable_to_opt"
2934
external to_opt : 'a t -> 'a option = "#nullable_to_opt"
3035
external return : 'a -> 'a t = "%identity"

jscomp/others/js_null_undefined.mli

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,11 @@
2424

2525
(** Contains functionality for dealing with values that can be both `null` and `undefined` *)
2626

27-
type +'a t = 'a Js.null_undefined
27+
type +'a t = 'a Js.nullable =
28+
| Present of 'a
29+
| Null [@as null]
30+
| Undefined [@as undefined]
31+
[@@unboxed]
2832
(** Local alias for `Js.null_undefined('a)`. *)
2933

3034
external return : 'a -> 'a t = "%identity"

0 commit comments

Comments
 (0)