-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: ensure that all assignees get a value (#630)
Closes partially #543 ### Summary of Changes Show an error if an assignee might not get a value. --------- Co-authored-by: megalinter-bot <129584137+megalinter-bot@users.noreply.github.com>
- Loading branch information
1 parent
01933b9
commit e8e2bf6
Showing
7 changed files
with
105 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,6 @@ | |
["(", ")"], | ||
["{", "}"], | ||
["[", "]"], | ||
["<", ">"], | ||
["»", "«"] | ||
], | ||
"autoClosingPairs": [ | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
83 changes: 83 additions & 0 deletions
83
tests/resources/validation/other/statements/assignments/nothing assigned/main.sdstest
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,83 @@ | ||
package tests.validation.other.statements.assignments.nothingAssigned | ||
|
||
fun noResults() | ||
fun oneResult() -> first: Int | ||
fun twoResults() -> (first: Int, second: Int) | ||
|
||
segment mySegment() -> ( | ||
r1: Any?, | ||
r2: Any?, | ||
r3: Any?, | ||
r4: Any?, | ||
r5: Any?, | ||
r6: Any?, | ||
r7: Any?, | ||
r8: Any?, | ||
r9: Any?, | ||
r10: Any?, | ||
r11: Any?, | ||
r12: Any?, | ||
r13: Any?, | ||
r14: Any?, | ||
) { | ||
// $TEST$ error "No value is assigned to this assignee." | ||
»_« = noResults(); | ||
// $TEST$ no error "No value is assigned to this assignee." | ||
// $TEST$ error "No value is assigned to this assignee." | ||
»_«, »_« = oneResult(); | ||
// $TEST$ no error "No value is assigned to this assignee." | ||
// $TEST$ no error "No value is assigned to this assignee." | ||
// $TEST$ error "No value is assigned to this assignee." | ||
»_«, »_«, »_« = twoResults(); | ||
// $TEST$ no error "No value is assigned to this assignee." | ||
// $TEST$ error "No value is assigned to this assignee." | ||
»_«, »_« = 1; | ||
// $TEST$ no error "No value is assigned to this assignee." | ||
// $TEST$ error "No value is assigned to this assignee." | ||
»_«, »_« = unresolved; | ||
// $TEST$ error "No value is assigned to this assignee." | ||
// $TEST$ error "No value is assigned to this assignee." | ||
»_«, »_« = unresolved(); | ||
|
||
// $TEST$ error "No value is assigned to this assignee." | ||
»val a« = noResults(); | ||
// $TEST$ no error "No value is assigned to this assignee." | ||
// $TEST$ error "No value is assigned to this assignee." | ||
»val b«, »val c« = oneResult(); | ||
// $TEST$ no error "No value is assigned to this assignee." | ||
// $TEST$ no error "No value is assigned to this assignee." | ||
// $TEST$ error "No value is assigned to this assignee." | ||
»val d«, »val e«, »val f« = twoResults(); | ||
// $TEST$ no error "No value is assigned to this assignee." | ||
// $TEST$ error "No value is assigned to this assignee." | ||
»val g«, »val h« = 1; | ||
// $TEST$ no error "No value is assigned to this assignee." | ||
// $TEST$ error "No value is assigned to this assignee." | ||
»val i«, »val j« = unresolved; | ||
// $TEST$ error "No value is assigned to this assignee." | ||
// $TEST$ error "No value is assigned to this assignee." | ||
»val k«, »val l« = unresolved(); | ||
|
||
// $TEST$ error "No value is assigned to this assignee." | ||
»yield r1« = noResults(); | ||
// $TEST$ no error "No value is assigned to this assignee." | ||
// $TEST$ error "No value is assigned to this assignee." | ||
»yield r2«, »yield r3« = oneResult(); | ||
// $TEST$ no error "No value is assigned to this assignee." | ||
// $TEST$ no error "No value is assigned to this assignee." | ||
// $TEST$ error "No value is assigned to this assignee." | ||
»yield r4«, »yield r5«, »yield r6« = twoResults(); | ||
// $TEST$ no error "No value is assigned to this assignee." | ||
// $TEST$ error "No value is assigned to this assignee." | ||
»yield r7«, »yield r8« = 1; | ||
// $TEST$ no error "No value is assigned to this assignee." | ||
»yield r9« = oneResult(); | ||
// $TEST$ no error "No value is assigned to this assignee." | ||
»yield r10« = twoResults(); | ||
// $TEST$ no error "No value is assigned to this assignee." | ||
// $TEST$ error "No value is assigned to this assignee." | ||
»yield r11«, »yield r12« = unresolved; | ||
// $TEST$ error "No value is assigned to this assignee." | ||
// $TEST$ error "No value is assigned to this assignee." | ||
»yield r13«, »yield r14« = unresolved(); | ||
} |