-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
warning cli: tweak single-letter warning deprecation (#10312)
cli: tweak warning cli deprecation With this commit using -w a+... and -w A+... does not trigger any deprecation message: The deprecation message only occurs when several unsigned letters are used in sequence.
- Loading branch information
Showing
3 changed files
with
70 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
(* TEST | ||
* expect | ||
*) | ||
|
||
(** Deprecated sequences of unsigned letters *) | ||
|
||
[@@@warning "fragile-math"] | ||
[%%expect {| | ||
Line 3, characters 0-27: | ||
3 | [@@@warning "fragile-math"] | ||
^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
Alert ocaml_deprecated_cli: Setting a warning with a sequence of lowercase or uppercase letters, | ||
like 'ath', is deprecated. | ||
Use the equivalent signed form: -f-r-a-g-i-l-e-m-a-t-h. | ||
Hint: Enabling or disabling a warning by its mnemonic name requires a + or - prefix. | ||
Hint: Did you make a spelling mistake when using a mnemonic name? | ||
|}] | ||
|
||
[@@@warning "ab-cdg+efh"] | ||
[%%expect {| | ||
Line 1, characters 0-25: | ||
1 | [@@@warning "ab-cdg+efh"] | ||
^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
Alert ocaml_deprecated_cli: Setting a warning with a sequence of lowercase or uppercase letters, | ||
like 'fh', is deprecated. | ||
Use the equivalent signed form: -a-b-c-d-g+e-f-h. | ||
Hint: Enabling or disabling a warning by its mnemonic name requires a + or - prefix. | ||
|}] | ||
|
||
|
||
(** -w "a+10..." and -w "A-10..." are still supported *) | ||
[@@@warning "a+1..20+50"] | ||
[%%expect {| | ||
|}] | ||
|
||
[@@@warning "A-3..14-56"] | ||
[%%expect {| | ||
|}] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters