-
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: mark unused internal/private segments as unnecessary (#710)
Closes #682 ### Summary of Changes Show a warning if internal/private segments are unused and mark them as unnecessary.
- Loading branch information
1 parent
9d342e4
commit 3ba8698
Showing
4 changed files
with
62 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
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
17 changes: 17 additions & 0 deletions
17
...s/safe-ds-lang/tests/resources/validation/other/declarations/segments/unused/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,17 @@ | ||
package tests.validation.other.declarations.segments.unused | ||
|
||
// $TEST$ warning "This segment is unused and can be removed." | ||
private segment »myUnusedPrivateSegment«() {} | ||
|
||
// $TEST$ no warning "This segment is unused and can be removed." | ||
private segment »myUsedPrivateSegment«() {} | ||
|
||
// $TEST$ warning "This segment is unused and can be removed." | ||
internal segment »myUnusedInternalSegment«() {} | ||
|
||
// $TEST$ no warning "This segment is unused and can be removed." | ||
internal segment »myUsedInternalSegment«() {} | ||
|
||
pipeline myPipeline1 { | ||
myUsedPrivateSegment(); | ||
} |
5 changes: 5 additions & 0 deletions
5
...s-lang/tests/resources/validation/other/declarations/segments/unused/same package.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,5 @@ | ||
package tests.validation.other.declarations.segments.unused | ||
|
||
pipeline myPipeline2 { | ||
myUsedInternalSegment(); | ||
} |