Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion jscomp/core/lam_coercion.ml
Original file line number Diff line number Diff line change
Expand Up @@ -210,5 +210,16 @@ let coerce_and_group_big_lambda
coerced_input,
{meta with export_idents = coerced_input.export_set ;
exports = coerced_input.export_list}
| _ -> assert false
| _ ->
(* This could happen see #2474*)
{
export_list = [];
export_set = Ident_set.empty;
export_map = Ident_map.empty ;
(** not used in code generation, mostly used
for store some information in cmj files *)
groups = [Nop lam] ;
(* all code to be compiled later = original code + rebound coercions *)
}
, { meta with export_idents = Ident_set.empty ; exports= []}

1 change: 1 addition & 0 deletions jscomp/test/.depend
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,7 @@ gpr_1943_test.cmj : mt.cmj
gpr_1946_test.cmj : ../stdlib/obj.cmj ../runtime/js.cmj
gpr_2250_test.cmj : mt.cmj
gpr_2316_test.cmj : mt.cmj ../runtime/js.cmj
gpr_2474.cmj :
gpr_405_test.cmj : ../stdlib/hashtbl.cmj gpr_405_test.cmi
gpr_441.cmj :
gpr_459_test.cmj : mt.cmj
Expand Down
1 change: 1 addition & 0 deletions jscomp/test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ OTHERS := test_literals a test_ari test_export2 test_internalOO test_obj_simple_
gpr_2316_test\
gpr_2250_test\
gpr_1285_test\
gpr_2474\
defunctor_make_test\
bs_hashtbl_string_test\
console_log_test\
Expand Down
14 changes: 14 additions & 0 deletions jscomp/test/gpr_2474.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
'use strict';

var Caml_builtin_exceptions = require("../../lib/js/caml_builtin_exceptions.js");

throw [
Caml_builtin_exceptions.match_failure,
[
"gpr_2474.ml",
6,
4
]
];

/* Not a pure module */
6 changes: 6 additions & 0 deletions jscomp/test/gpr_2474.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

[@@@warning"-a"]
let coordinates = 1


let 2 = coordinates
13 changes: 12 additions & 1 deletion lib/whole_compiler.ml
Original file line number Diff line number Diff line change
Expand Up @@ -90962,7 +90962,18 @@ let coerce_and_group_big_lambda
coerced_input,
{meta with export_idents = coerced_input.export_set ;
exports = coerced_input.export_list}
| _ -> assert false
| _ ->
(* This could happen see #2474*)
{
export_list = [];
export_set = Ident_set.empty;
export_map = Ident_map.empty ;
(** not used in code generation, mostly used
for store some information in cmj files *)
groups = [Nop lam] ;
(* all code to be compiled later = original code + rebound coercions *)
}
, { meta with export_idents = Ident_set.empty ; exports= []}


end
Expand Down