diff --git a/src/common/reason.ml b/src/common/reason.ml index 1a892b478b8..cd0b9edc399 100644 --- a/src/common/reason.ml +++ b/src/common/reason.ml @@ -164,7 +164,6 @@ type 'loc virtual_reason_desc = | RRestParameter of string option | RPatternParameter of string | RIdentifier of name - | RUnknownParameter of string | RIdentifierAssignment of string | RPropertyAssignment of string option | RProperty of name option @@ -295,13 +294,13 @@ let rec map_desc_locs f = function | RDefaultValue | RConstructor | RReturn | RDefaultConstructor | RRegExp | RSuper | RNoSuper | RDummyPrototype | RDummyThis | RTupleMap | RObjectMap | RType _ | RTypeof _ | RMethod _ | RMethodCall _ | RParameter _ | RRestParameter _ | RPatternParameter _ | RIdentifier _ - | RUnknownParameter _ | RIdentifierAssignment _ | RPropertyAssignment _ | RProperty _ - | RPrivateProperty _ | RMember _ | RPropertyIsAString _ | RMissingProperty _ - | RUnknownProperty _ | RUndefinedProperty _ | RSomeProperty | RFieldInitializer _ - | RUntypedModule _ | RNamedImportedType _ | RImportStarType _ | RImportStarTypeOf _ - | RImportStar _ | RDefaultImportedType _ | RAsyncImport | RCode _ | RCustom _ - | RIncompatibleInstantiation _ | ROpaqueType _ | RObjectMapi | RObjectKeyMirror - | RObjectMapConst | RIndexedAccess _ | RConditionalType | RInferType _ ) as r -> + | RIdentifierAssignment _ | RPropertyAssignment _ | RProperty _ | RPrivateProperty _ | RMember _ + | RPropertyIsAString _ | RMissingProperty _ | RUnknownProperty _ | RUndefinedProperty _ + | RSomeProperty | RFieldInitializer _ | RUntypedModule _ | RNamedImportedType _ + | RImportStarType _ | RImportStarTypeOf _ | RImportStar _ | RDefaultImportedType _ + | RAsyncImport | RCode _ | RCustom _ | RIncompatibleInstantiation _ | ROpaqueType _ + | RObjectMapi | RObjectKeyMirror | RObjectMapConst | RIndexedAccess _ | RConditionalType + | RInferType _ ) as r -> r | RConstructorCall desc -> RConstructorCall (map_desc_locs f desc) | RTypeAlias (s, None, d) -> RTypeAlias (s, None, map_desc_locs f d) @@ -665,7 +664,6 @@ let rec string_of_desc = function | RMethod (Some x) -> spf "method `%s`" x | RMethod None -> "computed method" | RIdentifier x -> spf "`%s`" (prettify_react_util (display_string_of_name x)) - | RUnknownParameter x -> spf "parameter `%s` of unknown type" (prettify_react_util x) | RIdentifierAssignment x -> spf "assignment of identifier `%s`" x | RMethodCall (Some x) -> spf "call of method `%s`" x | RMethodCall None -> "call of computed property" @@ -1492,7 +1490,6 @@ let classification_of_reason r = | RRestParameter _ | RPatternParameter _ | RIdentifier _ - | RUnknownParameter _ | RIdentifierAssignment _ | RPropertyAssignment _ | RProperty _ diff --git a/src/common/reason.mli b/src/common/reason.mli index 6d8f6e15571..36aebe8c244 100644 --- a/src/common/reason.mli +++ b/src/common/reason.mli @@ -123,7 +123,6 @@ type 'loc virtual_reason_desc = | RRestParameter of string option | RPatternParameter of string | RIdentifier of name - | RUnknownParameter of string | RIdentifierAssignment of string | RPropertyAssignment of string option | RProperty of name option diff --git a/src/typing/errors/flow_error.ml b/src/typing/errors/flow_error.ml index b8df76f1b72..c30694448fb 100644 --- a/src/typing/errors/flow_error.ml +++ b/src/typing/errors/flow_error.ml @@ -1190,30 +1190,6 @@ let rec make_error_printable : code (string_of_int n); text " characters are not treated as literals"; ] - | (RUnknownParameter n, _) -> - let message = - [ - ref lower; - text " is incompatible with "; - ref upper; - text " (consider adding a type annotation to "; - ref (update_desc_reason (fun _ -> RIdentifier (OrdinaryName n)) lower); - text ")"; - ] - in - make_error lower message - | (_, RUnknownParameter n) -> - let message = - [ - ref lower; - text " is incompatible with "; - ref upper; - text " (consider adding a type annotation to "; - ref (update_desc_reason (fun _ -> RIdentifier (OrdinaryName n)) upper); - text ")"; - ] - in - make_error lower message | _ -> make_error lower [ref lower; text " is incompatible with "; ref upper] end) in