Skip to content

Commit 32423ef

Browse files
committed
add unknown test
1 parent 8848116 commit 32423ef

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed

jscomp/test/test_unknown.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
'use strict';
2+
3+
var Caml_option = require("../../lib/js/caml_option.js");
4+
5+
function some(x) {
6+
return Caml_option.some(x);
7+
}
8+
9+
function some2(x) {
10+
return Caml_option.some(x);
11+
}
12+
13+
var h = [
14+
3,
15+
2,
16+
2
17+
];
18+
19+
exports.some = some;
20+
exports.some2 = some2;
21+
exports.h = h;
22+
/* No side effect */

jscomp/test/test_unknown.ml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
2+
3+
type t = unknown =
4+
| Unknown : _ -> t [@@unboxed]
5+
6+
7+
let some (x : unknown) = Some x
8+
9+
let some2 x = Some (Unknown x)
10+
11+
let h = [|Unknown 3 ; Unknown 2 ; Unknown (Some (Unknown 2))|]
12+
13+
type t0 = Any : _ -> t0 [@@unboxed]
14+
15+
type t1 = t0 = Any : _ -> t1 [@@unboxed]

0 commit comments

Comments
 (0)