-
-
Notifications
You must be signed in to change notification settings - Fork 843
Deprecate _ as x patterns #4683
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
Open
eutampieri
wants to merge
21
commits into
gleam-lang:main
Choose a base branch
from
eutampieri:main
base: main
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.
+102
−3
Open
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
c8e5793
Emit a warning for `_ as x`
eutampieri 9a1b44b
Have the formatter rewrite _ as y to y
eutampieri 9e56bf7
Emit a warning for the deprecation of `_ as a` syntax
eutampieri 3baa55b
Revert whitespace removal
eutampieri c0e10dc
Add test for unused discard pattern
eutampieri 14ce722
Add test for the rewrite of unused discard patterns
eutampieri efa5575
Add newline at the end of the test string for the unused_discard_patt…
eutampieri dc22a52
Update CHANGELOG
eutampieri 44a02cb
Move changelog item to the relevant section
eutampieri 2ed16df
Address review comment: better diagnostics
eutampieri 1123e1c
Remove dead code
eutampieri 6b3457b
Run cargo fmt
eutampieri 27445f9
Update snapshot for unused discard pattern test
eutampieri 85c4f9a
Various fixes
eutampieri 8c76d8b
Fix CHANGELOG formatting
eutampieri 68cf50e
Update snapshot for unused discard pattern warning test
eutampieri 751cf45
Unused discard pattern: extend the span to the end of the pattern
eutampieri eda20a3
Be a bit more explicit on unused discard pattern end location calcula…
eutampieri 8312ee8
Unused discard pattern warning: fix label position
eutampieri 74b0713
Fix unused discard pattern snapshot
eutampieri 127b73e
Revert bad merge resolution
eutampieri 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
23 changes: 23 additions & 0 deletions
23
...src/type_/tests/snapshots/gleam_core__type___tests__warnings__unused_discard_pattern.snap
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,23 @@ | ||
--- | ||
source: compiler-core/src/type_/tests/warnings.rs | ||
assertion_line: 4195 | ||
expression: "pub fn main() {\n let a = 10\n let _ = case a {\n _ as b -> b\n }\n}\n" | ||
snapshot_kind: text | ||
--- | ||
----- SOURCE CODE | ||
pub fn main() { | ||
let a = 10 | ||
let _ = case a { | ||
_ as b -> b | ||
} | ||
} | ||
|
||
|
||
----- WARNING | ||
warning: Unused discard pattern | ||
┌─ /src/warning/wrn.gleam:4:5 | ||
│ | ||
4 │ _ as b -> b | ||
│ ^^^^^^ | ||
|
||
`_ as b` can be written more concisely as `b` |
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
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.
Uh oh!
There was an error while loading. Please reload this page.