Skip to content

fix #5064 #5067

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 13, 2021
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
4 changes: 3 additions & 1 deletion jscomp/frontend/bs_ast_invariant.ml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
(* Copyright (C) 2015-2016 Bloomberg Finance L.P.
*
* Copyright (C) 2017- Hongbo Zhang, Authors of ReScript
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
Expand Down Expand Up @@ -185,6 +185,8 @@ let emit_external_warnings : iterator=
match pat.ppat_desc with
| Ppat_constant(constant) ->
check_constant pat.ppat_loc `pat constant
| Ppat_record ([],_) ->
Location.raise_errorf ~loc:pat.ppat_loc "Empty record pattern is not supported"
| _ -> super.pat self pat
end
}
Expand Down
1 change: 1 addition & 0 deletions jscomp/test/build.ninja
Original file line number Diff line number Diff line change
Expand Up @@ -548,6 +548,7 @@ o test/recursive_records_test.cmi test/recursive_records_test.cmj : cc test/recu
o test/recursive_unbound_module_test.cmi test/recursive_unbound_module_test.cmj : cc test/recursive_unbound_module_test.ml | $stdlib
o test/regression_print.cmi test/regression_print.cmj : cc test/regression_print.ml | $stdlib
o test/relative_path.cmi test/relative_path.cmj : cc test/relative_path.ml | $stdlib
o test/res_debug.cmi test/res_debug.cmj : cc test/res_debug.res | $stdlib
o test/return_check.cmi test/return_check.cmj : cc test/return_check.ml | $stdlib
o test/runtime_encoding_test.cmi test/runtime_encoding_test.cmj : cc test/runtime_encoding_test.ml | $stdlib
o test/scanf_io.cmi test/scanf_io.cmj : cc test/scanf_io.ml | test/testing.cmj $stdlib
Expand Down
7 changes: 7 additions & 0 deletions jscomp/test/res_debug.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
'use strict';


var u = 0;

exports.u = u;
/* No side effect */
19 changes: 19 additions & 0 deletions jscomp/test/res_debug.res
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
@@config({
flags: [
/* "-w";
"@A" */
/* "-drawlambda"; */
/* "-dtypedtree"; */
/* "-bs-diagnose"; */
"-dparsetree",
/* "-dsource"; */
],
})
type t = { x : int, y : int}

// let f = (x,y) => {
// let {} = {x,y}
// x + y
// }

let u = #0
4 changes: 3 additions & 1 deletion lib/4.06.1/unstable/js_compiler.ml
Original file line number Diff line number Diff line change
Expand Up @@ -398359,7 +398359,7 @@ val emit_external_warnings_on_signature:
end = struct
#1 "bs_ast_invariant.ml"
(* Copyright (C) 2015-2016 Bloomberg Finance L.P.
*
* Copyright (C) 2017- Hongbo Zhang, Authors of ReScript
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
Expand Down Expand Up @@ -398533,6 +398533,8 @@ let emit_external_warnings : iterator=
match pat.ppat_desc with
| Ppat_constant(constant) ->
check_constant pat.ppat_loc `pat constant
| Ppat_record ([],_) ->
Location.raise_errorf ~loc:pat.ppat_loc "Empty record pattern is not supported"
| _ -> super.pat self pat
end
}
Expand Down
4 changes: 3 additions & 1 deletion lib/4.06.1/whole_compiler.ml
Original file line number Diff line number Diff line change
Expand Up @@ -293901,7 +293901,7 @@ val emit_external_warnings_on_signature:
end = struct
#1 "bs_ast_invariant.ml"
(* Copyright (C) 2015-2016 Bloomberg Finance L.P.
*
* Copyright (C) 2017- Hongbo Zhang, Authors of ReScript
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
Expand Down Expand Up @@ -294075,6 +294075,8 @@ let emit_external_warnings : iterator=
match pat.ppat_desc with
| Ppat_constant(constant) ->
check_constant pat.ppat_loc `pat constant
| Ppat_record ([],_) ->
Location.raise_errorf ~loc:pat.ppat_loc "Empty record pattern is not supported"
| _ -> super.pat self pat
end
}
Expand Down