Skip to content

Remove obsolete option -bs-unsafe-empty-array #7635

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 2 commits into from
Jul 12, 2025
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
- Remove internal/unused `-bs-v` flag. https://github.com/rescript-lang/rescript/pull/7627
- Remove unused `-bs-D` and `-bs-list-conditionals` flags. https://github.com/rescript-lang/rescript/pull/7631
- Remove obsolete jsx options. https://github.com/rescript-lang/rescript/pull/7633
- Remove obsolete option `-bs-unsafe-empty-array`. https://github.com/rescript-lang/rescript/pull/7635

# 12.0.0-beta.1

Expand Down
3 changes: 0 additions & 3 deletions compiler/bsc/rescript_compiler_main.ml
Original file line number Diff line number Diff line change
Expand Up @@ -310,9 +310,6 @@ let command_line_flags : (string * Bsc_args.spec * string) array =
( "-unboxed-types",
set Clflags.unboxed_types,
"*internal* Unannotated unboxable types will be unboxed" );
( "-bs-unsafe-empty-array",
set Config.unsafe_empty_array,
"*internal* Allow [||] to be polymorphic" );
("-nostdlib", set Js_config.no_stdlib, "*internal* Don't use stdlib");
( "-color",
string_call set_color_option,
Expand Down
2 changes: 0 additions & 2 deletions compiler/ext/config.ml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ let standard_library =

let standard_library_default = standard_library

let unsafe_empty_array = ref false

let cmi_magic_number = "Caml1999I022"

and ast_impl_magic_number = "Caml1999M022"
Expand Down
2 changes: 0 additions & 2 deletions compiler/ext/config.mli
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ val version : string
val standard_library : string
(* The directory containing the standard libraries *)

val unsafe_empty_array : bool ref

val load_path : string list ref
(* Directories in the search path for .cmi and .cmo files *)

Expand Down
8 changes: 4 additions & 4 deletions compiler/ml/typecore.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1804,7 +1804,7 @@ let rec is_nonexpansive exp =
fields
&& is_nonexpansive_opt extended_expression
| Texp_field (exp, _, _) -> is_nonexpansive exp
| Texp_array [] -> !Config.unsafe_empty_array
| Texp_array [] -> false
| Texp_ifthenelse (_cond, ifso, ifnot) ->
is_nonexpansive ifso && is_nonexpansive_opt ifnot
| Texp_sequence (_e1, e2) -> is_nonexpansive e2 (* PR#4354 *)
Expand Down Expand Up @@ -3750,7 +3750,7 @@ and type_construct ~context env loc lid sarg ty_expected attrs =
exp_env = env;
}
in
(* Forward context if this is a Some constructor injected (meaning it's
(* Forward context if this is a Some constructor injected (meaning it's
an optional field) *)
let context =
match lid.txt with
Expand Down Expand Up @@ -4484,9 +4484,9 @@ let report_error env loc ppf error =
context."
| Uncurried_arity_mismatch (typ, arity, args, sargs) ->
(* We need:
- Any arg that's required but isn't passed
- Any arg that's required but isn't passed
- Any arg that is passed but isn't in the fn definition (optional or labelled)
- Any mismatch in the number of unlabelled args (since all of them are required)
- Any mismatch in the number of unlabelled args (since all of them are required)
*)
let rec collect_args ?(acc = []) typ =
match typ.desc with
Expand Down
9 changes: 0 additions & 9 deletions tests/tests/src/poly_empty_array.mjs

This file was deleted.

2 changes: 0 additions & 2 deletions tests/tests/src/poly_empty_array.res

This file was deleted.