Skip to content

Commit 5a84d12

Browse files
committed
1 parent eafb929 commit 5a84d12

9 files changed

+88
-9
lines changed

.github/CHECK_LIST.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
Before a bug report, please confirm if it is reproducible in master, we fix bugs quickly, so it may already be fixed in master.
2+
13
## Checklist
24

35
* [x] Does your title concisely summarize the problem?

jscomp/bin/whole_compiler.ml

+2-2
Original file line numberDiff line numberDiff line change
@@ -96767,8 +96767,8 @@ and
9676796767
| {block = []; value = Some out1},
9676896768
{block = []; value = Some out2} ->
9676996769
(* Invariant: should_return is false*)
96770-
Js_output.make [
96771-
S.define ~kind id (E.econd e out1 out2) ]
96770+
Js_output.make @@ (b @ [
96771+
S.define ~kind id (E.econd e out1 out2) ])
9677296772
| _, _ ->
9677396773
Js_output.make
9677496774
( b @ [

jscomp/core/lam_compile.ml

+2-2
Original file line numberDiff line numberDiff line change
@@ -971,8 +971,8 @@ and
971971
| {block = []; value = Some out1},
972972
{block = []; value = Some out2} ->
973973
(* Invariant: should_return is false*)
974-
Js_output.make [
975-
S.define ~kind id (E.econd e out1 out2) ]
974+
Js_output.make @@ (b @ [
975+
S.define ~kind id (E.econd e out1 out2) ])
976976
| _, _ ->
977977
Js_output.make
978978
( b @ [

jscomp/core/lam_compile_group.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ let lambda_as_module
385385
begin
386386
Js_config.set_current_file filename ;
387387
#if BS_DEBUG then
388-
Js_config.set_debug_file "rec_fun_test.ml";
388+
Js_config.set_debug_file "gpr_1749_test.ml";
389389
#end
390390
let lambda_output = compile ~filename output_prefix env sigs lam in
391391
let (//) = Filename.concat in

jscomp/test/.depend

+1
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,7 @@ gpr_1701_test.cmj : ../stdlib/list.cmj
234234
gpr_1716_test.cmj : mt.cmj
235235
gpr_1717_test.cmj :
236236
gpr_1728_test.cmj : mt.cmj
237+
gpr_1749_test.cmj : mt.cmj
237238
gpr_405_test.cmj : ../stdlib/hashtbl.cmj gpr_405_test.cmi
238239
gpr_441.cmj :
239240
gpr_459_test.cmj : mt.cmj

jscomp/test/Makefile

+2-1
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,8 @@ OTHERS := literals a test_ari test_export2 test_internalOO test_obj_simple_ffi t
167167
gpr_1716_test\
168168
gpr_1728_test\
169169
gpr_1409_test\
170-
rec_fun_test
170+
rec_fun_test\
171+
gpr_1749_test
171172
# bs_uncurry_test
172173
# needs Lam to get rid of Uncurry arity first
173174

jscomp/test/gpr_1749_test.js

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
'use strict';
2+
3+
var Mt = require("./mt.js");
4+
var Block = require("../../lib/js/block.js");
5+
6+
var suites = [/* [] */0];
7+
8+
var test_id = [0];
9+
10+
function eq(loc, x, y) {
11+
test_id[0] = test_id[0] + 1 | 0;
12+
suites[0] = /* :: */[
13+
/* tuple */[
14+
loc + (" id " + test_id[0]),
15+
(function () {
16+
return /* Eq */Block.__(0, [
17+
x,
18+
y
19+
]);
20+
})
21+
],
22+
suites[0]
23+
];
24+
return /* () */0;
25+
}
26+
27+
var match = +(1 < 1);
28+
29+
var a = 1 < (
30+
match !== 0 ? 1 : 10
31+
) ? 0 : 1;
32+
33+
eq("File \"gpr_1749_test.ml\", line 18, characters 6-13", 0, a);
34+
35+
Mt.from_pair_suites("gpr_1749_test.ml", suites[0]);
36+
37+
exports.suites = suites;
38+
exports.test_id = test_id;
39+
exports.eq = eq;
40+
exports.a = a;
41+
/* Not a pure module */

jscomp/test/gpr_1749_test.ml

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
2+
let suites : Mt.pair_suites ref = ref []
3+
let test_id = ref 0
4+
let eq loc x y =
5+
incr test_id ;
6+
suites :=
7+
(loc ^" id " ^ (string_of_int !test_id), (fun _ -> Mt.Eq(x,y))) :: !suites
8+
9+
10+
11+
let a =
12+
if 1. < (match 1. < 1. with | true -> 1. | false -> 10.)
13+
then 0
14+
else 1
15+
16+
17+
18+
;; eq __LOC__ 0 a
19+
;; Mt.from_pair_suites __FILE__ !suites
20+

jscomp/test/ocaml_typedtree_test.js

+17-3
Original file line numberDiff line numberDiff line change
@@ -66496,9 +66496,9 @@ function check_well_founded(env, loc, path, to_check, ty) {
6649666496
var ty$1 = repr(ty);
6649766497
if (mem$3(ty$1, exp_nodes)) {
6649866498
var match = ty0[/* desc */0];
66499-
var $js$2;
66500-
$js$2 = typeof match === "number" || match.tag !== 3 ? /* false */0 : same(match[0], path);
66501-
if ($js$2) {
66499+
var $js;
66500+
$js = typeof match === "number" || match.tag !== 3 ? /* false */0 : same(match[0], path);
66501+
if ($js) {
6650266502
throw [
6650366503
$$Error$8,
6650466504
loc,
@@ -66565,6 +66565,20 @@ function check_well_founded(env, loc, path, to_check, ty) {
6656566565
catch (raw_exn){
6656666566
var exn$1 = Js_exn.internalToOCamlException(raw_exn);
6656766567
if (exn$1 === Cannot_expand) {
66568+
var match$3 = ty$1[/* desc */0];
66569+
var $js$1;
66570+
if (typeof match$3 === "number") {
66571+
$js$1 = /* false */0;
66572+
} else {
66573+
switch (match$3.tag | 0) {
66574+
case 4 :
66575+
case 8 :
66576+
$js$1 = /* true */1;
66577+
break;
66578+
default:
66579+
$js$1 = /* false */0;
66580+
}
66581+
}
6656866582
var nodes = recursive_types[0] && is_contractive(env, ty$1) || $js$1 ? /* Empty */0 : exp_nodes$1;
6656966583
return iter_type_expr((function (param) {
6657066584
return check(ty0, nodes, param);

0 commit comments

Comments
 (0)