Skip to content

Commit fcf002b

Browse files
committed
add a test case
1 parent 1cff795 commit fcf002b

File tree

7 files changed

+51
-0
lines changed

7 files changed

+51
-0
lines changed

jscomp/test/build.ninja

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,9 @@ build test/gpr_3609_test.cmi test/gpr_3609_test.cmj : cc test/gpr_3609_test.ml |
297297
build test/gpr_3697_test.cmi test/gpr_3697_test.cmj : cc test/gpr_3697_test.ml | $stdlib
298298
build test/gpr_373_test.cmi test/gpr_373_test.cmj : cc test/gpr_373_test.ml | $stdlib
299299
build test/gpr_3770_test.cmi test/gpr_3770_test.cmj : cc test/gpr_3770_test.ml | $stdlib
300+
build test/gpr_3865.cmi test/gpr_3865.cmj : cc test/gpr_3865.re | test/gpr_3865_bar.cmj test/gpr_3865_foo.cmj $stdlib
301+
build test/gpr_3865_bar.cmi test/gpr_3865_bar.cmj : cc test/gpr_3865_bar.re | $stdlib
302+
build test/gpr_3865_foo.cmi test/gpr_3865_foo.cmj : cc test/gpr_3865_foo.re | $stdlib
300303
build test/gpr_405_test.cmj : cc_cmi test/gpr_405_test.ml | test/gpr_405_test.cmi $stdlib
301304
build test/gpr_405_test.cmi : cc test/gpr_405_test.mli | $stdlib
302305
build test/gpr_441.cmi test/gpr_441.cmj : cc test/gpr_441.ml | $stdlib

jscomp/test/gpr_3865.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
'use strict';
2+
3+
var Gpr_3865_foo = require("./gpr_3865_foo.js");
4+
5+
var B = {
6+
$$return: Gpr_3865_foo.$$return
7+
};
8+
9+
console.log(Gpr_3865_foo.$$return);
10+
11+
console.log(Gpr_3865_foo.$$return);
12+
13+
var F = 0;
14+
15+
exports.F = F;
16+
exports.B = B;
17+
/* Not a pure module */

jscomp/test/gpr_3865.re

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module F = Gpr_3865_foo;
2+
module B = Gpr_3865_bar.Make(Gpr_3865_foo);
3+
4+
Js.log(F.return);
5+
Js.log(B.return);

jscomp/test/gpr_3865_bar.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
'use strict';
2+
3+
4+
function Make(M) {
5+
return {
6+
$$return: M.$$return
7+
};
8+
}
9+
10+
exports.Make = Make;
11+
/* No side effect */

jscomp/test/gpr_3865_bar.re

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module type S = {
2+
let return: int;
3+
}
4+
5+
module Make = (M: S) => {
6+
include M;
7+
}

jscomp/test/gpr_3865_foo.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
'use strict';
2+
3+
4+
var $$return = 5;
5+
6+
exports.$$return = $$return;
7+
/* No side effect */

jscomp/test/gpr_3865_foo.re

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
let return = 5;

0 commit comments

Comments
 (0)