Skip to content
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

fix UnusedScalafixSuppression warnings on Scala 3 scalafix invocations #1979

Merged
merged 1 commit into from
May 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion project/Mima.scala
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ object Mima {
ProblemFilters.exclude[Problem]("scalafix.internal.*"),
ProblemFilters.exclude[Problem]("scala.meta.internal.*"),
// Exceptions
ProblemFilters.exclude[DirectMissingMethodProblem]("scalafix.Versions.scala211")
ProblemFilters.exclude[DirectMissingMethodProblem]("scalafix.v0.Signature#Self.syntax")
)
}
}
6 changes: 2 additions & 4 deletions scalafix-core/src/main/scala/scalafix/v0/Signature.scala
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,8 @@ object Signature {
}

final case class Self(name: String) extends Signature {
override def syntax =
throw new UnsupportedOperationException(
"No longer supported."
) // scalafix:ok
override def syntax: String =
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator Author

@bjaglin bjaglin Apr 21, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[error] Module scalafix-core:0.12.0+48-ad1d9456-SNAPSHOT is not binary compatible with scalafix-core_2.12:0.12.0.
[error] You have to relax our compatibility intention by changing the value of versionPolicyIntention, or to fix the incompatibilities.
[error] We found the following incompatibilities:
[error]    * method syntax()scala.runtime.Nothing# in class scalafix.v0.Signature#Self does not have a correspondent in current version
[error]      filter with: ProblemFilters.exclude[DirectMissingMethodProblem]("scalafix.v0.Signature#Self.syntax")

it's an binary breaking change that looks insignificant (as it's unlikely that community rules relies on the previous signature), moreover on an old API version, so it's fine to ignore it

throw new UnsupportedOperationException("No longer supported.")
override def structure: String = s"""Signature.Self("$name")"""
override def toString: String = syntax
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ package test
object DenotationOpsTest {
def m(x: Int, y: String): List[String] = List(y)
var x = true
val y = m(42, "hey")
private val y = m(42, "hey")
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ package test

class TypesTest {
val a = 42
val b = List(42)
private val b = List(42)
class Inner
val c = new TypesTest
val d = new c.Inner
val e = null.asInstanceOf[TypesTest#Inner]
private val e = null.asInstanceOf[TypesTest#Inner]
val f: {
def foo(a: Int): Int
def bar(a: Int): Int
Expand Down