Skip to content

Commit

Permalink
add issue filter for StringPrefix.apply
Browse files Browse the repository at this point in the history
  • Loading branch information
ckipp01 committed Jul 4, 2022
1 parent 27def9a commit e69b4c0
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
16 changes: 14 additions & 2 deletions build.sc
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,20 @@ val scalaJSVersions = scalaVersions.map((_, "1.10.1"))
val scalaNativeVersions = scalaVersions.map((_, "0.4.5"))

trait MimaCheck extends Mima {
def crossScalaVersion: String

def mimaPreviousVersions = VcsVersion.vcsState().lastTag.toSeq

// By default in sbt-mima IncompatibleSignatureProblem is actually turned off
// by default due to false positives. We hit on this with 2.13 > 2.13.6 with
// * static method apply(scala.collection.Iterable)java.lang.String in class pprint.StringPrefix has a different generic signature in current version, where it is (Lscala/collection/Iterable<Ljava/lang/Object;>;)Ljava/lang/String; rather than (Lscala/collection/Iterable<*>;)Ljava/lang/String;. See https://github.com/lightbend/mima#incompatiblesignatureproblem
def mimaBinaryIssueFilters = if (crossScalaVersion.startsWith("2.13")) {
super.mimaBinaryIssueFilters() ++ Seq(
ProblemFilter.exclude[IncompatibleSignatureProblem]("pprint.StringPrefix.apply")
)
} else {
super.mimaBinaryIssueFilters()
}
}

trait PPrintModule extends PublishModule with MimaCheck {
Expand Down Expand Up @@ -100,6 +113,7 @@ object pprint extends Module {
object js extends Cross[JsPPrintModule](scalaJSVersions:_*)
class JsPPrintModule(val crossScalaVersion: String, crossJSVersion: String)
extends PPrintMainModule with ScalaJSModule with PPrintModule {

def offset = os.up
def scalaJSVersion = crossJSVersion
object test extends Tests with PPrintTestModule{
Expand All @@ -113,8 +127,6 @@ object pprint extends Module {
extends PPrintMainModule with ScalaNativeModule with PPrintModule {
def offset = os.up
def scalaNativeVersion = crossScalaNativeVersion
// Remove after Scala Native Scala 3 artifacts are published
//def mimaPreviousArtifacts = T{ if(isScala3(scalaVersion())) Seq() else super.mimaPreviousArtifacts() }
object test extends Tests with PPrintTestModule{
def offset = os.up
val crossScalaVersion = NativePPrintModule.this.crossScalaVersion
Expand Down
2 changes: 1 addition & 1 deletion pprint/src-2.13/pprint/StringPrefix.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ package pprint

object StringPrefix{
def apply(i: Iterable[_]) = i.asInstanceOf[{ def collectionClassName: String }].collectionClassName
}
}

0 comments on commit e69b4c0

Please sign in to comment.