-
Notifications
You must be signed in to change notification settings - Fork 185
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
run RemoveUnused #1922
run RemoveUnused #1922
Conversation
d889523
to
9581ff0
Compare
@@ -1,7 +1,6 @@ | |||
package scalafix.internal.patch | |||
|
|||
import scala.annotation.tailrec | |||
import scala.collection.compat._ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This false positive comes from the Scala3 run:
[warn] Failed to parse `-Wconf` configuration: origin=scala.collection.compat.*:s
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We will need to either revisit #1797, revert it or stop running RemoveUnused
on Scala 3 for projects that use scala.collection.compat.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I ended up patching NoAutoTupling.scala
& EscapeHatch.scala
as they didn't make a critical usage of scala.collection.compat.
@@ -28,9 +28,9 @@ trait TypeToTreeInput { | |||
def r(vararg: String*): String | |||
def s[c[x] <: Seq[x]](e: c[String]): c[Int] | |||
type S = Functor[({ type T[A] = Either[Int, A] })#T] | |||
private def t1: Unit = () |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
file to be ignored via //scalafix: off
7ba3294
to
2f8744e
Compare
2f8744e
to
ffbe321
Compare
@@ -169,7 +169,6 @@ trait BaseCliSuite extends AnyFunSuite with DiffAssertions { | |||
files: String = removeImportsPath.toString() | |||
): Unit = { | |||
test(name, SkipWindows) { | |||
val fileIsFixed = expectedExit.isOk |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unused + no side effect -> line removed manually
|
||
class ExplicitSynthetic() extends SemanticRule("ExplicitSynthetic") { | ||
import scalafix.v1._ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems that in Scala3, the SemanticRule
reference above is found thanks to this, making the top-level import unused. To get a consistent behavior across Scala versions, I just hoisted them.
Follows #1918, #1728 & #1800