Skip to content

Commit 2aa42dd

Browse files
jbrown215facebook-github-bot
authored andcommitted
[easy] Fix some formatting in flow_js.ml
Summary: Came across this while scrolling. I removed some indentation and a newline. The phabricator changes don't really show my fully changes (I guess because it's mostly whitespace?). Expand up 20 lines to see/take a look at diffusion/FBS/browse/master/fbcode/flow/src/typing/flow_js.ml;3204f32528de152bc0164e787f358754bcb7798d$9518-9550 Reviewed By: panagosg7 Differential Revision: D15564782 fbshipit-source-id: e718c7927c8a276e61078b9ffb16388c4f942923
1 parent 2ccf7c1 commit 2aa42dd

File tree

1 file changed

+35
-36
lines changed

1 file changed

+35
-36
lines changed

src/typing/flow_js.ml

Lines changed: 35 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -9513,42 +9513,41 @@ and flow_use_op op1 u =
95139513
u
95149514
else
95159515
mod_use_op_of_use_t (fun op2 ->
9516-
let root_of_op2 = root_of_use_op op2 in
9517-
let should_replace = fold_use_op
9518-
(* If the root of the previous use_op is UnknownUse and our alternate
9519-
* use_op does not have an UnknownUse root then we use our
9520-
* alternate use_op. *)
9521-
ignore_root
9522-
(fun should_replace -> function
9523-
(* If the use was added to an implicit type param then we want to use
9524-
* our alternate if the implicit type param use_op chain is inside
9525-
* the implicit type param instantiation. Since we can't directly compare
9526-
* abstract locations, we determine whether to do this using a heuristic
9527-
* based on the 'locality' of the use_op root. *)
9528-
| ImplicitTypeParam when not should_replace ->
9529-
(match root_of_op2 with
9530-
| FunCall {local; _} | FunCallMethod {local; _} ->
9531-
local
9532-
| Addition _
9533-
| AssignVar _
9534-
| Coercion _
9535-
| FunImplicitReturn _ | FunReturnStatement _
9536-
| GetProperty _ | SetProperty _
9537-
| JSXCreateElement _
9538-
| ObjectSpread _ | ObjectChain _
9539-
| TypeApplication _
9540-
-> true
9541-
| Cast _
9542-
| ClassExtendsCheck _ | ClassImplementsCheck _ | ClassOwnProtoCheck _
9543-
| GeneratorYield _
9544-
| Internal _
9545-
| ReactCreateElementCall _ | ReactGetIntrinsic _
9546-
| Speculation _ | UnknownUse
9547-
-> false)
9548-
| _ -> should_replace)
9549-
op2
9550-
in
9551-
if should_replace then op1 else op2
9516+
let root_of_op2 = root_of_use_op op2 in
9517+
let should_replace = fold_use_op
9518+
(* If the root of the previous use_op is UnknownUse and our alternate
9519+
* use_op does not have an UnknownUse root then we use our
9520+
* alternate use_op. *)
9521+
ignore_root
9522+
(fun should_replace -> function
9523+
(* If the use was added to an implicit type param then we want to use
9524+
* our alternate if the implicit type param use_op chain is inside
9525+
* the implicit type param instantiation. Since we can't directly compare
9526+
* abstract locations, we determine whether to do this using a heuristic
9527+
* based on the 'locality' of the use_op root. *)
9528+
| ImplicitTypeParam when not should_replace ->
9529+
(match root_of_op2 with
9530+
| FunCall {local; _} | FunCallMethod {local; _} ->
9531+
local
9532+
| Addition _
9533+
| AssignVar _
9534+
| Coercion _
9535+
| FunImplicitReturn _ | FunReturnStatement _
9536+
| GetProperty _ | SetProperty _
9537+
| JSXCreateElement _
9538+
| ObjectSpread _ | ObjectChain _
9539+
| TypeApplication _
9540+
-> true
9541+
| Cast _
9542+
| ClassExtendsCheck _ | ClassImplementsCheck _ | ClassOwnProtoCheck _
9543+
| GeneratorYield _
9544+
| Internal _
9545+
| ReactCreateElementCall _ | ReactGetIntrinsic _
9546+
| Speculation _ | UnknownUse
9547+
-> false)
9548+
| _ -> should_replace)
9549+
op2 in
9550+
if should_replace then op1 else op2
95529551
) u
95539552

95549553
(***********************)

0 commit comments

Comments
 (0)