-
Notifications
You must be signed in to change notification settings - Fork 482
Fix directive @warning("-102") not working
#8322
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
cknitt
wants to merge
8
commits into
master
Choose a base branch
from
warning-102
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
8f4f487
Fix @warning("-102") not working
cknitt 1654767
fix
cknitt f9e78f2
Fix
cknitt fdc694b
Fix
cknitt b738319
.resi tests
cknitt a937c43
Simplify
cknitt ee289bc
Update comment
cknitt c4f4a87
Fix
cknitt File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
10 changes: 10 additions & 0 deletions
10
tests/build_tests/super_errors/expected/malformed_warning_attribute.res.expected
This file contains hidden or 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,10 @@ | ||
|
|
||
| [1;33mWarning number 47[0m | ||
| [36m/.../fixtures/malformed_warning_attribute.res[0m:[2m1:1-9[0m | ||
|
|
||
| [1;33m1[0m [2m│[0m [1;33m@@warning[0m(123) | ||
| 2 [2m│[0m | ||
| 3 [2m│[0m let x = 1 | ||
|
|
||
| illegal payload for attribute 'warning'. | ||
| A single string literal is expected |
10 changes: 10 additions & 0 deletions
10
tests/build_tests/super_errors/expected/malformed_warning_attribute.resi.expected
This file contains hidden or 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,10 @@ | ||
|
|
||
| [1;33mWarning number 47[0m | ||
| [36m/.../fixtures/malformed_warning_attribute.resi[0m:[2m1:1-9[0m | ||
|
|
||
| [1;33m1[0m [2m│[0m [1;33m@@warning[0m(123) | ||
| 2 [2m│[0m | ||
| 3 [2m│[0m let x: int | ||
|
|
||
| illegal payload for attribute 'warning'. | ||
| A single string literal is expected |
12 changes: 12 additions & 0 deletions
12
...ld_tests/super_errors/expected/nested_malformed_warning_signature_attribute.resi.expected
This file contains hidden or 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,12 @@ | ||
|
|
||
| [1;33mWarning number 47[0m | ||
| [36m/.../fixtures/nested_malformed_warning_signature_attribute.resi[0m:[2m3:3-11[0m | ||
|
|
||
| 1 [2m│[0m module M: { | ||
| 2 [2m│[0m let y: int | ||
| [1;33m3[0m [2m│[0m [1;33m@@warning[0m(123) | ||
| 4 [2m│[0m } | ||
| 5 [2m│[0m | ||
|
|
||
| illegal payload for attribute 'warning'. | ||
| A single string literal is expected |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning_attribute_iteratornow applies everyPstr_attribute/Psig_attributeduring a full AST walk, but this mutates the global warning state without any restore. Because this prepass runs before typing, non-leading or nested@@warningdirectives are effectively active from the start of compilation (and can leak outside their intended scope), so warnings in earlier or outer code can be incorrectly suppressed/enabled; for example, a nested module-level@@warning("-32")can silence outer unused-value warnings.Useful? React with 👍 / 👎.