Skip to content

Commit 7895c4c

Browse files
authored
test: demonstrate wrong compilation of option type match (#1522)
1 parent 44b24d1 commit 7895c4c

1 file changed

Lines changed: 31 additions & 0 deletions

File tree

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
2+
$ . ./setup.sh
3+
4+
$ cat > x.ml <<EOF
5+
> let foo a =
6+
> let a = Some a in
7+
> match a with
8+
> | Some true -> "it's true"
9+
> | _ -> "it's false"
10+
> let () = Js.log (foo false)
11+
> EOF
12+
13+
$ melc x.ml | tee x.js
14+
// Generated by Melange
15+
'use strict';
16+
17+
18+
function foo(a) {
19+
return "it's true";
20+
}
21+
22+
console.log("it's true");
23+
24+
module.exports = {
25+
foo,
26+
}
27+
/* Not a pure module */
28+
29+
$ node x.js
30+
it's true
31+

0 commit comments

Comments
 (0)