Skip to content

Commit dff9315

Browse files
authored
Merge pull request #4385 from BuckleScript/tweak_lazy_encoding
bump version to v8, enable strict-sequence, strict-formats, fix #4245
2 parents 6b1af98 + 6de3486 commit dff9315

File tree

15 files changed

+37
-58
lines changed

15 files changed

+37
-58
lines changed
Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
Warning number 5 (configured as error)
2+
We've found a bug for you!
33
/.../fixtures/warnings1.re 3:3-7
44

55
1 │ let x = (a, b) => a + b;
@@ -8,5 +8,7 @@
88
4 │ 10
99
5 │ };
1010

11-
this function application is partial,
12-
maybe some arguments are missing.
11+
This has type:
12+
int => int
13+
But somewhere wanted:
14+
unit
Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11

2-
Warning number 10
2+
We've found a bug for you!
33
/.../fixtures/warnings2.re 2:3-4
44

55
1 │ let z = () => {
6-
2 │ 10;
6+
2 │ 10;
77
3 │ 10
88
4 │ };
99

10-
This expression returns a value, but you're not doing anything with it. If this is on purpose, wrap it with `ignore`.
10+
This has type:
11+
int
12+
But somewhere wanted:
13+
unit

jscomp/common/bs_version.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
* You should have received a copy of the GNU Lesser General Public License
2323
* along with this program; if not, write to the Free Software
2424
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)
25-
let version = "7.4.0-dev.1"
25+
let version = "8.0.0-dev.1"
2626
let header =
2727
"// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE"
2828
let package_name = "bs-platform"

jscomp/core/bs_conditional_initial.ml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ let setup_env () =
4444
Clflags.debug := true;
4545
Clflags.record_event_when_debug := false;
4646
Clflags.binary_annotations := true;
47-
(* Clflags.strict_sequence := true; *)
47+
Clflags.strict_sequence := true;
48+
Clflags.strict_formats := true;
4849
(* Turn on [-no-alias-deps] by default -- double check *)
4950
Oprint.out_ident := Outcome_printer_ns.out_ident;
5051
Builtin_attributes.check_bs_attributes_inclusion := Record_attributes_check.check_bs_attributes_inclusion;

jscomp/core/ocaml_options.ml

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -134,10 +134,6 @@ let mk_short_paths f =
134134
"-stdin", Arg.Unit f, " Read script from standard input"
135135
;; *)
136136

137-
let mk_strict_sequence f =
138-
"-strict-sequence", Arg.Unit f,
139-
" Left-hand part of a sequence must have type unit"
140-
;;
141137

142138
let mk_unsafe f =
143139
"-unsafe", Arg.Unit f,
@@ -235,14 +231,6 @@ let mk_dlambda f =
235231
\ (reduces necessary recompilation on module change)"
236232
;; *)
237233

238-
let mk_strict_formats f =
239-
"-strict-formats", Arg.Unit f,
240-
" Reject invalid formats accepted by legacy implementations\n\
241-
\ (Warning: Invalid formats may behave differently from\n\
242-
\ previous OCaml versions, and will become always-rejected\n\
243-
\ in future OCaml versions. You should use this flag\n\
244-
\ to detect and fix invalid formats.)"
245-
;;
246234

247235
(* let mk__ f =
248236
"-", Arg.String f,
@@ -309,8 +297,6 @@ let ocaml_options =
309297
let _rectypes = set Clflags.recursive_types in
310298
(* let _safe_string = unset unsafe_string in *)
311299
let _short_paths = unset Clflags.real_paths in
312-
let _strict_sequence = set Clflags.strict_sequence in
313-
let _strict_formats = set Clflags.strict_formats in
314300
let _unsafe = set Clflags.fast in
315301
(* let _unsafe_string = set unsafe_string in *)
316302
(* let _v () = print_version_and_library "compiler" in *)
@@ -359,8 +345,6 @@ let ocaml_options =
359345
mk_rectypes _rectypes;
360346
(* mk_safe_string _safe_string; *)
361347
mk_short_paths _short_paths;
362-
mk_strict_sequence _strict_sequence;
363-
mk_strict_formats _strict_formats;
364348
mk_unsafe _unsafe;
365349
mk_v _v;
366350
mk_verbose _verbose;

jscomp/test/caml_format_test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -980,7 +980,7 @@ var formatter_suites_001 = /* :: */[
980980
])
981981
])
982982
]),
983-
"@[%23d %2i %3u %4n %0xl %0xL %N %03x %X %o %s %S %c %C %3f %2F %2e %E %g %G %B %b %ld %li %lu %lx %lX %lo %nd %ni %nu %nx %nx %no @]"
983+
"@[%23d %2i %3u %n %0xl %0xL %N %03x %X %o %s %S %c %C %3f %2F %2e %E %g %G %B %b %ld %li %lu %lx %lX %lo %nd %ni %nu %nx %nx %no @]"
984984
]), [
985985
1,
986986
2,

jscomp/test/caml_format_test.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ let formatter_suites = Mt.[
8080
"fmt_gen",
8181
(fun _ -> Eq(Format.asprintf ("%s %03d %L" ^^ "%S %03d %L %a" ) "32" 33 33 "a" 33 3 (Format.pp_print_list Format.pp_print_int) [1;2;3], "32 033 33\"a\" 033 3 12\n3"));
8282
"long_fmt", (fun _ -> Eq(Format.asprintf "%d %i %u %n %l %L %N %x %X %o %s %S %c %C %f %F %e %E %g %G %B %b %ld %li %lu %lx %lX %lo %nd %ni %nu %nx %nx %no " 1 2 3 4 5 6 7 8 9 10 "a" "b" 'c' 'd' 1. 2. 3. 4. 5. 6. true false 0l 1l 2l 3l 4l 5l 6n 7n 8n 9n 10n 11n , "1 2 3 4 5 6 7 8 9 12 a \"b\" c 'd' 1.000000 2. 3.000000e+00 4.000000E+00 5 6 true false 0 1 2 3 4 5 6 7 8 9 a 13 "));
83-
"long_fmt_2", (fun _ -> Eq(Format.asprintf "@[%23d %2i %3u %4n %0xl %0xL %N %03x %X %o %s %S %c %C %3f %2F %2e %E %g %G %B %b %ld %li %lu %lx %lX %lo %nd %ni %nu %nx %nx %no @]" 1 2 3 4 5 6 7 8 9 10 "a" "b" 'c' 'd' 1. 2. 3. 4. 5. 6. true false 0l 1l 2l 3l 4l 5l 6n 7n 8n 9n 10n 11n, " 1 2 3 4 5l 6L 7 008 9 12 a \"b\" c 'd' 1.000000 2. 3.000000e+00 4.000000E+00 5 6 true false 0 1 2 3 4 5 6 7 8 9 a 13 "));
83+
"long_fmt_2", (fun _ -> Eq(Format.asprintf "@[%23d %2i %3u %n %0xl %0xL %N %03x %X %o %s %S %c %C %3f %2F %2e %E %g %G %B %b %ld %li %lu %lx %lX %lo %nd %ni %nu %nx %nx %no @]" 1 2 3 4 5 6 7 8 9 10 "a" "b" 'c' 'd' 1. 2. 3. 4. 5. 6. true false 0l 1l 2l 3l 4l 5l 6n 7n 8n 9n 10n 11n, " 1 2 3 4 5l 6L 7 008 9 12 a \"b\" c 'd' 1.000000 2. 3.000000e+00 4.000000E+00 5 6 true false 0 1 2 3 4 5 6 7 8 9 a 13 "));
8484
"width_1", (fun _ -> Eq(Format.asprintf "%014d" 32, "00000000000032"));
8585
"width_2", (fun _ -> Eq(Format.asprintf "%10.3f" 32333.02, " 32333.020"));
8686
"alternate_1", (fun _ -> Eq(Format.asprintf "%0x" 32333, "7e4d"));

jscomp/test/debug_tmp.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11

22
[@@@bs.config {
33
flags = [|
4-
"-drawlambda";
4+
(* "-drawlambda"; *)
55
(* "-dlambda"; *)
66
(* "-dtypedtree"; *)
77
(* "-bs-diagnose" *)
8-
(* FIXME: empty array pattern match is fishy after fix array polymorphic error *)
8+
99
|]
1010
}]
1111

lib/4.06.1/bsb.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ end = struct
5555
* You should have received a copy of the GNU Lesser General Public License
5656
* along with this program; if not, write to the Free Software
5757
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)
58-
let version = "7.4.0-dev.1"
58+
let version = "8.0.0-dev.1"
5959
let header =
6060
"// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE"
6161
let package_name = "bs-platform"

lib/4.06.1/unstable/bsb_native.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ end = struct
5555
* You should have received a copy of the GNU Lesser General Public License
5656
* along with this program; if not, write to the Free Software
5757
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)
58-
let version = "7.4.0-dev.1"
58+
let version = "8.0.0-dev.1"
5959
let header =
6060
"// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE"
6161
let package_name = "bs-platform"

0 commit comments

Comments
 (0)