Skip to content

Commit a544484

Browse files
arthaudfacebook-github-bot
authored andcommitted
Move the unexpected statement error after the parser error
Summary: Those are logically the most general type of errors, let's put them on the top. Reviewed By: dkgi Differential Revision: D28950396 fbshipit-source-id: 0b3fa257a5c42ea1315aafa9f0b1ec67a940c8be
1 parent c8b8aea commit a544484

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

source/interprocedural_analyses/taint/modelVerificationError.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ module T = struct
2020

2121
type kind =
2222
| ParseError
23+
| UnexpectedStatement of Statement.t
2324
| InvalidDefaultValue of {
2425
callable_name: string;
2526
name: string;
@@ -70,7 +71,6 @@ module T = struct
7071
unexpected_decorators: Statement.Decorator.t list;
7172
}
7273
| InvalidIdentifier of Expression.t
73-
| UnexpectedStatement of Statement.t
7474
| ClassBodyNotEllipsis of string
7575
| DefineBodyNotEllipsis of string
7676
(* TODO(T81363867): Remove this variant. *)
@@ -93,6 +93,7 @@ include T
9393
let description error =
9494
match error with
9595
| ParseError -> "Syntax error."
96+
| UnexpectedStatement _ -> "Unexpected statement."
9697
| InvalidDefaultValue { callable_name; name; expression } ->
9798
Format.sprintf
9899
"Default values of `%s`'s parameters must be `...`. Did you mean to write `%s: %s`?"
@@ -179,7 +180,6 @@ let description error =
179180
Format.sprintf
180181
"Invalid identifier: `%s`. Expected a fully-qualified name."
181182
(Expression.show expression)
182-
| UnexpectedStatement _ -> "Unexpected statement."
183183
| ClassBodyNotEllipsis class_name ->
184184
Format.sprintf "Class model for `%s` must have a body of `...`." class_name
185185
| DefineBodyNotEllipsis model_name ->

source/interprocedural_analyses/taint/modelVerificationError.mli

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ module T : sig
1818

1919
type kind =
2020
| ParseError
21+
| UnexpectedStatement of Statement.t
2122
| InvalidDefaultValue of {
2223
callable_name: string;
2324
name: string;
@@ -68,7 +69,6 @@ module T : sig
6869
unexpected_decorators: Statement.Decorator.t list;
6970
}
7071
| InvalidIdentifier of Expression.t
71-
| UnexpectedStatement of Statement.t
7272
| ClassBodyNotEllipsis of string
7373
| DefineBodyNotEllipsis of string
7474
| UnclassifiedError of {

0 commit comments

Comments
 (0)