Skip to content

Commit

Permalink
[flow] Remove insert_type special case for $Call
Browse files Browse the repository at this point in the history
Summary:
As we deleted most of the $Call, this case won't be hit in 99.999% of cases. When we delete $Call support, this case will never be hit. This diff deletes this special case first.

Changelog: [internal]

Reviewed By: gkz

Differential Revision: D62783367

fbshipit-source-id: ebb056e1ec343b613b1c19f27f39ad7950a343e4
  • Loading branch information
SamChou19815 authored and facebook-github-bot committed Sep 17, 2024
1 parent 1997ffe commit bb26172
Showing 1 changed file with 0 additions and 24 deletions.
24 changes: 0 additions & 24 deletions src/services/code_action/insert_type_utils.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1280,30 +1280,6 @@ class type_normalization_hardcoded_fixes_mapper
when metadata.Context.facebook_fbt = Some "FbtElement" ->
let symbol = { symbol with Ty.sym_name = Reason.OrdinaryName "Fbt" } in
Ty.(Generic (symbol, Ty.TypeAliasKind, None))
(*
* Minimal form of evaluating utility types:
*
* $Call<<K>(_0: K) => K, T, ...> --> T
*)
| Ty.(
Utility
(Call
( Fun
{
fun_type_params =
Some
[{ tp_name = p; tp_bound = None; tp_polarity = Neutral; tp_default = None }];
fun_params = [(_, Bound (_, b), { prm_optional = false })];
fun_rest_param = None;
fun_return = ReturnType (Bound (_, r));
fun_static = _;
fun_effect = _;
},
t :: _
)
))
when p = b && b = r ->
this#on_t env t
| Ty.Obj { Ty.obj_def_loc = Some aloc; _ } ->
let remote_file = Base.Option.value_exn (ALoc.source aloc) in
if String.ends_with (File_key.to_string remote_file) ~suffix:"graphql.js" then
Expand Down

0 comments on commit bb26172

Please sign in to comment.