From 1d6ec18e6ba0a7b4b21f60f985d9920ef5dfab74 Mon Sep 17 00:00:00 2001 From: Sam Zhou Date: Wed, 17 Apr 2024 16:33:36 -0700 Subject: [PATCH] [flow][cleanup][EZ] Kill `EFunPredInvalidIndex` Summary: Unused Changelog: [internal] Reviewed By: gkz Differential Revision: D56271373 fbshipit-source-id: a5859eca8d1256175d10eb9fe86e412f246bd48a --- src/typing/debug_js.ml | 1 - src/typing/errors/error_message.ml | 15 --------------- 2 files changed, 16 deletions(-) diff --git a/src/typing/debug_js.ml b/src/typing/debug_js.ml index d49479bcfe2..7612e2c88a9 100644 --- a/src/typing/debug_js.ml +++ b/src/typing/debug_js.ml @@ -1541,7 +1541,6 @@ let dump_error_message = | EAmbiguousNumericKeyWithVariance loc -> spf "EAmbiguousNumericKeyWithVariance (%s)" (string_of_aloc loc) | EPredicateFuncTooShort { loc; _ } -> spf "EPredicateFuncTooShort (%s)" (string_of_aloc loc) - | EFunPredInvalidIndex loc -> spf "EFunPredInvalidIndex (%s)" (string_of_aloc loc) | EPredicateFuncArityMismatch { use_op; _ } -> spf "EPredicateFuncArityMismatch (%s)" (string_of_use_op use_op) | EPredicateFuncIncompatibility { use_op; _ } -> diff --git a/src/typing/errors/error_message.ml b/src/typing/errors/error_message.ml index 44271903773..a8bfc0f0587 100644 --- a/src/typing/errors/error_message.ml +++ b/src/typing/errors/error_message.ml @@ -331,7 +331,6 @@ and 'loc t' = pred_reason: 'loc virtual_reason; binding_reason: 'loc virtual_reason; } - | EFunPredInvalidIndex of 'loc | ETypeGuardIndexMismatch of { use_op: 'loc virtual_use_op; reasons: 'loc virtual_reason * 'loc virtual_reason; @@ -1172,7 +1171,6 @@ let rec map_loc_of_error_message (f : 'a -> 'b) : 'a t' -> 'b t' = } | ETypeGuardIncompatibleWithFunctionKind { loc; kind } -> ETypeGuardIncompatibleWithFunctionKind { loc = f loc; kind } - | EFunPredInvalidIndex loc -> EFunPredInvalidIndex (f loc) | EInternal (loc, i) -> EInternal (f loc, i) | EUnsupportedSyntax (loc, u) -> EUnsupportedSyntax (f loc, u) | EUseArrayLiteral loc -> EUseArrayLiteral (f loc) @@ -1642,7 +1640,6 @@ let util_use_op_of_msg nope util = function | EPredicateFuncArityMismatch _ | EPredicateFuncIncompatibility _ | EPredicateInvalidParameter _ - | EFunPredInvalidIndex _ | ETypeGuardIndexMismatch _ | EInternal (_, _) | EUnsupportedSyntax (_, _) @@ -1924,7 +1921,6 @@ let loc_of_msg : 'loc t' -> 'loc option = function | ETrivialRecursiveDefinition (loc, _) | EInvalidCatchParameterAnnotation loc | EInvalidMappedType { loc; _ } - | EFunPredInvalidIndex loc | EPredicateFuncTooShort { loc; _ } | ETSSyntax { loc; _ } | EReferenceInAnnotation (loc, _, _) @@ -3013,16 +3009,6 @@ let friendly_message_of_msg loc_of_aloc msg = use_op; explanation = None; } - | EFunPredInvalidIndex _ -> - Normal - { - features = - [ - text "The index position of a "; - code "$Refine"; - text " type needs to be a positive integer."; - ]; - } | EPredicateInvalidParameter { pred_reason; binding_reason } -> Normal { @@ -5677,7 +5663,6 @@ let error_code_of_message err : error_code option = | EFunctionCallExtraArg _ -> Some ExtraArg | EPredicateFuncTooShort _ | EPredicateFuncArityMismatch _ - | EFunPredInvalidIndex _ | EPredicateFuncIncompatibility _ | EPredicateInvalidParameter _ | ETypeGuardIndexMismatch _