-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add missing cases to var usage analysis (#2251)
Fixes #2250. Some term constructors (records, type annotations) were missing, but no one ever realized since there was a catch-all `_ -> mempty` case at the end. This PR: - adds the missing cases - adds some associated tests - explicitly enumerates the other non-variable cases so that in the future, when we add a new term constructor we will get a warning.
- Loading branch information
Showing
6 changed files
with
41 additions
and
1 deletion.
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
data/test/language-snippets/warnings/unused-vars/lambda-with-annot.sw
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 @@ | ||
def put = \y. place (y : Text); end; |
1 change: 1 addition & 0 deletions
1
data/test/language-snippets/warnings/unused-vars/lambda-with-record-unused.sw
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 @@ | ||
def put = \y. [x = 3, z = 7]; end; |
1 change: 1 addition & 0 deletions
1
data/test/language-snippets/warnings/unused-vars/lambda-with-record-used-abbrev.sw
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 @@ | ||
def put = \y. [x = 3, y]; end; |
1 change: 1 addition & 0 deletions
1
data/test/language-snippets/warnings/unused-vars/lambda-with-record-used.sw
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 @@ | ||
def put = \y. [x = 3, z = y + 2]; end; |
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