diff --git a/CHANGELOG.md b/CHANGELOG.md index 2e71fa7ae5..751a837ea3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/compiler/bsc/rescript_compiler_main.ml b/compiler/bsc/rescript_compiler_main.ml index a975a3073f..e91361d1ac 100644 --- a/compiler/bsc/rescript_compiler_main.ml +++ b/compiler/bsc/rescript_compiler_main.ml @@ -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, diff --git a/compiler/ext/config.ml b/compiler/ext/config.ml index 0df8d7c50b..7e14bd9d9c 100644 --- a/compiler/ext/config.ml +++ b/compiler/ext/config.ml @@ -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" diff --git a/compiler/ext/config.mli b/compiler/ext/config.mli index 0bd4de3027..63d200f81d 100644 --- a/compiler/ext/config.mli +++ b/compiler/ext/config.mli @@ -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 *) diff --git a/compiler/ml/typecore.ml b/compiler/ml/typecore.ml index db953b073c..a1abc0dc4d 100644 --- a/compiler/ml/typecore.ml +++ b/compiler/ml/typecore.ml @@ -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 *) @@ -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 @@ -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 diff --git a/tests/tests/src/poly_empty_array.mjs b/tests/tests/src/poly_empty_array.mjs deleted file mode 100644 index 99ba29d762..0000000000 --- a/tests/tests/src/poly_empty_array.mjs +++ /dev/null @@ -1,9 +0,0 @@ -// Generated by ReScript, PLEASE EDIT WITH CARE - - -let a = []; - -export { - a, -} -/* No side effect */ diff --git a/tests/tests/src/poly_empty_array.res b/tests/tests/src/poly_empty_array.res deleted file mode 100644 index 06375bd609..0000000000 --- a/tests/tests/src/poly_empty_array.res +++ /dev/null @@ -1,2 +0,0 @@ -@@config({flags: ["-bs-unsafe-empty-array"]}) -let a = []