@@ -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