Skip to content

Commit

Permalink
[flow][cleanup] Flow_js_utils.add_output no longer accepts traces
Browse files Browse the repository at this point in the history
Summary:
Now that it's no longer used at all, let's just remove the trace param.

Changelog: [internal]

Reviewed By: panagosg7

Differential Revision: D56735980

fbshipit-source-id: 29e41343adfc7b7847a57afa1c56b3a9c4565fae
  • Loading branch information
SamChou19815 authored and facebook-github-bot committed Apr 30, 2024
1 parent b356743 commit 3f4eb8b
Show file tree
Hide file tree
Showing 13 changed files with 130 additions and 281 deletions.
2 changes: 1 addition & 1 deletion src/analysis/env_builder/dependency_sigs.ml
Expand Up @@ -28,5 +28,5 @@ end
module type F = sig
type cx

val add_output : cx -> ?trace:Type.trace -> ALoc.t Error_message.t' -> unit
val add_output : cx -> ALoc.t Error_message.t' -> unit
end
2 changes: 1 addition & 1 deletion src/analysis/env_builder/name_def_ordering.ml
Expand Up @@ -1567,7 +1567,7 @@ end
module DummyFlow (Context : C) = struct
type cx = Context.t

let add_output _ ?trace:_ _ = ()
let add_output _ _ = ()
end

module Make_Test_With_Cx (Context : C) = Make (Context) (DummyFlow (Context))
2 changes: 1 addition & 1 deletion src/analysis/env_builder/name_resolver.ml
Expand Up @@ -5809,7 +5809,7 @@ end
module DummyFlow (Context : C) = struct
type cx = Context.t

let add_output _ ?trace:_ _ = ()
let add_output _ _ = ()
end

module Make_Test_With_Cx (Context : C) = Make (Context) (DummyFlow (Context))
10 changes: 1 addition & 9 deletions src/typing/annotation_inference.ml
Expand Up @@ -1092,15 +1092,7 @@ module rec ConsGen : S = struct
reposition cx (loc_of_reason reason_op) value
| (DefT (_, NumT _), Annot_ElemT (reason_op, use_op, DefT (reason_tup, ArrT arrtype))) ->
let (value, _, _, _) =
Flow_js_utils.array_elem_check
~write_action:false
cx
dummy_trace
t
use_op
reason_op
reason_tup
arrtype
Flow_js_utils.array_elem_check ~write_action:false cx t use_op reason_op reason_tup arrtype
in
reposition cx (loc_of_reason reason_op) value
| (DefT (_, ObjT o), Annot_ObjKeyMirror reason_op) ->
Expand Down
1 change: 0 additions & 1 deletion src/typing/check_polarity.ml
Expand Up @@ -23,7 +23,6 @@ module Kit (Flow : Flow_common.S) : Flow_common.CHECK_POLARITY = struct
if not (Polarity.compat (tp.polarity, polarity)) then
Flow_js_utils.add_output
cx
?trace
(Error_message.EPolarityMismatch
{
reason;
Expand Down
4 changes: 2 additions & 2 deletions src/typing/custom_fun_kit.ml
Expand Up @@ -72,7 +72,7 @@ module Kit (Flow : Flow_common.S) : CUSTOM_FUN = struct
(* React.createElement() *)
| _ ->
(* If we don't have the arguments we need, add an arity error. *)
add_output cx ~trace (Error_message.EReactElementFunArity (reason_op, "createElement", 1)))
add_output cx (Error_message.EReactElementFunArity (reason_op, "createElement", 1)))
| ReactCloneElement ->
(match args with
(* React.cloneElement(element) *)
Expand Down Expand Up @@ -131,7 +131,7 @@ module Kit (Flow : Flow_common.S) : CUSTOM_FUN = struct
(* React.cloneElement() *)
| _ ->
(* If we don't have the arguments we need, add an arity error. *)
add_output cx ~trace (Error_message.EReactElementFunArity (reason_op, "cloneElement", 1)))
add_output cx (Error_message.EReactElementFunArity (reason_op, "cloneElement", 1)))
| ObjectAssign
| ObjectGetPrototypeOf
| ObjectSetPrototypeOf
Expand Down

0 comments on commit 3f4eb8b

Please sign in to comment.