diff --git a/src/typing/errors/flow_error.ml b/src/typing/errors/flow_error.ml index c30694448fb..62720832ea1 100644 --- a/src/typing/errors/flow_error.ml +++ b/src/typing/errors/flow_error.ml @@ -617,12 +617,6 @@ let rec make_error_printable : frames bound [text "Cannot use "; desc bound; text " as the bound of infer type "; desc infer] - | Op (ConditionalTypeEval { check_type_reason; extends_type_reason }) -> - root - loc - frames - check_type_reason - [text "Cannot check "; desc check_type_reason; text " against "; desc extends_type_reason] | Frame (FunParam _, Op (JSXCreateElement { op; component; _ })) | Op (JSXCreateElement { op; component; _ }) -> root_with_specific_reason diff --git a/src/typing/flow_js.ml b/src/typing/flow_js.ml index 8dd5c856a6e..d47ab8f3b1a 100644 --- a/src/typing/flow_js.ml +++ b/src/typing/flow_js.ml @@ -8919,7 +8919,6 @@ struct | GetProperty _ | IndexedTypeAccess _ | InferBoundCompatibilityCheck _ - | ConditionalTypeEval _ | EvalMappedType _ | SetProperty _ | UpdateProperty _ diff --git a/src/typing/type.ml b/src/typing/type.ml index 25c3046ae5d..3599f001acb 100644 --- a/src/typing/type.ml +++ b/src/typing/type.ml @@ -399,10 +399,6 @@ module rec TypeTerm : sig _object: 'loc virtual_reason; index: 'loc virtual_reason; } - | ConditionalTypeEval of { - check_type_reason: 'loc virtual_reason; - extends_type_reason: 'loc virtual_reason; - } | InitField of { op: 'loc virtual_reason; body: 'loc virtual_reason; @@ -4135,7 +4131,6 @@ let string_of_root_use_op (type a) : a virtual_root_use_op -> string = function | GetProperty _ -> "GetProperty" | IndexedTypeAccess _ -> "IndexedTypeAccess" | InferBoundCompatibilityCheck _ -> "InferBoundCompatibilityCheck" - | ConditionalTypeEval _ -> "ConditionalTypeEval" | JSXCreateElement _ -> "JSXCreateElement" | ReactCreateElementCall _ -> "ReactCreateElementCall" | ReactGetIntrinsic _ -> "ReactGetIntrinsic" diff --git a/src/typing/typeUtil.ml b/src/typing/typeUtil.ml index 27786b26b5b..6d0de0efc5a 100644 --- a/src/typing/typeUtil.ml +++ b/src/typing/typeUtil.ml @@ -652,12 +652,6 @@ let rec mod_loc_of_virtual_use_op f = IndexedTypeAccess { _object = mod_reason _object; index = mod_reason index } | InferBoundCompatibilityCheck { bound; infer } -> InferBoundCompatibilityCheck { bound = mod_reason bound; infer = mod_reason infer } - | ConditionalTypeEval { check_type_reason; extends_type_reason } -> - ConditionalTypeEval - { - check_type_reason = mod_reason check_type_reason; - extends_type_reason = mod_reason extends_type_reason; - } | JSXCreateElement { op; component } -> JSXCreateElement { op = mod_reason op; component = mod_reason component } | ReactCreateElementCall { op; component; children } -> diff --git a/src/typing/type_annotation.ml b/src/typing/type_annotation.ml index f69e0ff3b60..4149d62e68b 100644 --- a/src/typing/type_annotation.ml +++ b/src/typing/type_annotation.ml @@ -562,20 +562,11 @@ module Make (ConsGen : Type_annotation_sig.ConsGen) (Statement : Statement_sig.S let (((_, false_t), _) as false_type) = convert env false_type in let t = let reason = mk_reason RConditionalType loc in - let use_op = - Op - (ConditionalTypeEval - { - check_type_reason = reason_of_t check_t; - extends_type_reason = reason_of_t extends_t; - } - ) - in let destructor = ConditionalType { distributive_tparam_name; infer_tparams; extends_t; true_t; false_t } in let cx = env.cx in - mk_type_destructor cx use_op reason check_t destructor (mk_eval_id cx loc) + mk_type_destructor cx unknown_use reason check_t destructor (mk_eval_id cx loc) in ( (loc, t), Conditional { Conditional.check_type; extends_type; true_type; false_type; comments } diff --git a/src/typing/type_sig_merge.ml b/src/typing/type_sig_merge.ml index 764e0231627..75482ed2fe8 100644 --- a/src/typing/type_sig_merge.ml +++ b/src/typing/type_sig_merge.ml @@ -807,20 +807,11 @@ and merge_annot env file = function in let true_t = merge { env with tps = tps_for_true_type } file true_type in let false_t = merge env file false_type in - let use_op = - Type.Op - (Type.ConditionalTypeEval - { - check_type_reason = TypeUtil.reason_of_t check_t; - extends_type_reason = TypeUtil.reason_of_t extends_t; - } - ) - in Type.( EvalT ( check_t, TypeDestructorT - ( use_op, + ( unknown_use, reason, ConditionalType { distributive_tparam_name; infer_tparams; extends_t; true_t; false_t }