Skip to content

Commit fecb194

Browse files
authored
Remove obsolete option -bs-unsafe-empty-array (#7635)
* Remove obsolete option -bs-unsafe-empty-array * CHANGELOG
1 parent 7c7a004 commit fecb194

File tree

7 files changed

+5
-22
lines changed

7 files changed

+5
-22
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
- Remove internal/unused `-bs-v` flag. https://github.com/rescript-lang/rescript/pull/7627
1818
- Remove unused `-bs-D` and `-bs-list-conditionals` flags. https://github.com/rescript-lang/rescript/pull/7631
1919
- Remove obsolete jsx options. https://github.com/rescript-lang/rescript/pull/7633
20+
- Remove obsolete option `-bs-unsafe-empty-array`. https://github.com/rescript-lang/rescript/pull/7635
2021

2122
# 12.0.0-beta.1
2223

compiler/bsc/rescript_compiler_main.ml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -310,9 +310,6 @@ let command_line_flags : (string * Bsc_args.spec * string) array =
310310
( "-unboxed-types",
311311
set Clflags.unboxed_types,
312312
"*internal* Unannotated unboxable types will be unboxed" );
313-
( "-bs-unsafe-empty-array",
314-
set Config.unsafe_empty_array,
315-
"*internal* Allow [||] to be polymorphic" );
316313
("-nostdlib", set Js_config.no_stdlib, "*internal* Don't use stdlib");
317314
( "-color",
318315
string_call set_color_option,

compiler/ext/config.ml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ let standard_library =
3333

3434
let standard_library_default = standard_library
3535

36-
let unsafe_empty_array = ref false
37-
3836
let cmi_magic_number = "Caml1999I022"
3937

4038
and ast_impl_magic_number = "Caml1999M022"

compiler/ext/config.mli

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ val version : string
2121
val standard_library : string
2222
(* The directory containing the standard libraries *)
2323

24-
val unsafe_empty_array : bool ref
25-
2624
val load_path : string list ref
2725
(* Directories in the search path for .cmi and .cmo files *)
2826

compiler/ml/typecore.ml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1804,7 +1804,7 @@ let rec is_nonexpansive exp =
18041804
fields
18051805
&& is_nonexpansive_opt extended_expression
18061806
| Texp_field (exp, _, _) -> is_nonexpansive exp
1807-
| Texp_array [] -> !Config.unsafe_empty_array
1807+
| Texp_array [] -> false
18081808
| Texp_ifthenelse (_cond, ifso, ifnot) ->
18091809
is_nonexpansive ifso && is_nonexpansive_opt ifnot
18101810
| Texp_sequence (_e1, e2) -> is_nonexpansive e2 (* PR#4354 *)
@@ -3750,7 +3750,7 @@ and type_construct ~context env loc lid sarg ty_expected attrs =
37503750
exp_env = env;
37513751
}
37523752
in
3753-
(* Forward context if this is a Some constructor injected (meaning it's
3753+
(* Forward context if this is a Some constructor injected (meaning it's
37543754
an optional field) *)
37553755
let context =
37563756
match lid.txt with
@@ -4484,9 +4484,9 @@ let report_error env loc ppf error =
44844484
context."
44854485
| Uncurried_arity_mismatch (typ, arity, args, sargs) ->
44864486
(* We need:
4487-
- Any arg that's required but isn't passed
4487+
- Any arg that's required but isn't passed
44884488
- Any arg that is passed but isn't in the fn definition (optional or labelled)
4489-
- Any mismatch in the number of unlabelled args (since all of them are required)
4489+
- Any mismatch in the number of unlabelled args (since all of them are required)
44904490
*)
44914491
let rec collect_args ?(acc = []) typ =
44924492
match typ.desc with

tests/tests/src/poly_empty_array.mjs

Lines changed: 0 additions & 9 deletions
This file was deleted.

tests/tests/src/poly_empty_array.res

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)