diff --git a/src/common/reason.ml b/src/common/reason.ml index cec624eb8e6..e5d6774b6d3 100644 --- a/src/common/reason.ml +++ b/src/common/reason.ml @@ -1350,9 +1350,6 @@ let mk_initial_arguments_reason = let mk_pattern_reason ((loc, _) as patt) = mk_reason (RCode (code_desc_of_pattern patt)) loc -(* TODO: replace RCustom descriptions with proper descriptions *) -let unknown_elem_empty_array_desc = RCustom "unknown element type of empty array" - (* Classifies a reason description. These classifications can be used to * implement various asthetic behaviors in error messages when we would like to * distinguish between different error "classes". diff --git a/src/common/reason.mli b/src/common/reason.mli index 94f6d4aca23..7d52e528cf1 100644 --- a/src/common/reason.mli +++ b/src/common/reason.mli @@ -366,8 +366,6 @@ val mk_initial_arguments_reason : val mk_pattern_reason : (ALoc.t, ALoc.t) Flow_ast.Pattern.t -> reason -val unknown_elem_empty_array_desc : reason_desc - val invalidate_rtype_alias : 'loc virtual_reason_desc -> 'loc virtual_reason_desc val code_desc_of_expression : wrap:bool -> ('a, 'b) Flow_ast.Expression.t -> string diff --git a/src/typing/env_resolution.ml b/src/typing/env_resolution.ml index d0d2243f265..c313a7ea90b 100644 --- a/src/typing/env_resolution.ml +++ b/src/typing/env_resolution.ml @@ -709,7 +709,7 @@ let rec resolve_binding cx reason loc b = (func_type, use_op) | Root (EmptyArray { array_providers; arr_loc }) -> let (elem_t, tuple_view, reason) = - let element_reason = mk_reason Reason.unknown_elem_empty_array_desc loc in + let element_reason = mk_reason REmptyArrayElement loc in if ALocSet.cardinal array_providers > 0 then ( let ts = ALocSet.elements array_providers diff --git a/src/typing/statement.ml b/src/typing/statement.ml index bedeecbb84d..f8181a44a84 100644 --- a/src/typing/statement.ml +++ b/src/typing/statement.ml @@ -2505,7 +2505,7 @@ module Make and empty_array cx loc = let reason = mk_reason REmptyArrayLit loc in - let element_reason = mk_reason Reason.unknown_elem_empty_array_desc loc in + let element_reason = mk_reason REmptyArrayElement loc in let (has_hint, lazy_hint) = Type_env.get_hint cx loc in (* empty array, analogous to object with implicit properties *) let elemt = @@ -2704,7 +2704,7 @@ module Make (match elements with | [] when Context.typing_mode cx <> Context.CheckingMode -> let reason = mk_reason REmptyArrayLit loc in - let element_reason = mk_reason Reason.unknown_elem_empty_array_desc loc in + let element_reason = mk_reason REmptyArrayElement loc in let elem_t = Context.mk_placeholder cx element_reason in ( ( loc, DefT