Skip to content

Commit

Permalink
[flow] Kill RUnknownParameter
Browse files Browse the repository at this point in the history
Summary:
unused

Changelog: [internal]

Reviewed By: panagosg7

Differential Revision: D56048523

fbshipit-source-id: 791b89bd420d809e42b104a13aaa54282a41826b
  • Loading branch information
SamChou19815 authored and facebook-github-bot committed Apr 12, 2024
1 parent 6d9a35d commit 768376f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 35 deletions.
17 changes: 7 additions & 10 deletions src/common/reason.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -1492,7 +1490,6 @@ let classification_of_reason r =
| RRestParameter _
| RPatternParameter _
| RIdentifier _
| RUnknownParameter _
| RIdentifierAssignment _
| RPropertyAssignment _
| RProperty _
Expand Down
1 change: 0 additions & 1 deletion src/common/reason.mli
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
24 changes: 0 additions & 24 deletions src/typing/errors/flow_error.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 768376f

Please sign in to comment.