-
Notifications
You must be signed in to change notification settings - Fork 185
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
RemoveUnused: support Term.Block RHS in unused Defn
- Loading branch information
Showing
5 changed files
with
118 additions
and
12 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
26 changes: 26 additions & 0 deletions
26
...x-tests/input/src/main/scala-3/test/removeUnused/RemoveUnusedSignificantIndentation.scala
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,26 @@ | ||
/* | ||
rules = RemoveUnused | ||
*/ | ||
package test.removeUnused | ||
|
||
object RemoveUnusedTermsSignificantIndentation: | ||
|
||
private val a = | ||
println(5) | ||
|
||
private var b1 = | ||
println("foo") | ||
1 | ||
|
||
private val b2 = | ||
{ println("foo") } | ||
{ 1 } | ||
|
||
private | ||
var | ||
b3: | ||
Integer | ||
= // preserved | ||
// preserved | ||
println("foo") | ||
1 |
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
18 changes: 18 additions & 0 deletions
18
...-tests/output/src/main/scala-3/test/removeUnused/RemoveUnusedSignificantIndentation.scala
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,18 @@ | ||
package test.removeUnused | ||
|
||
object RemoveUnusedTermsSignificantIndentation: | ||
|
||
println(5) | ||
|
||
locally: | ||
println("foo") | ||
1 | ||
|
||
locally: | ||
{ println("foo") } | ||
{ 1 } | ||
|
||
locally: // preserved | ||
// preserved | ||
println("foo") | ||
1 |
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