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

False positives on dropped bridge method forwarders #388

Open
dwijnand opened this issue Sep 18, 2019 · 0 comments
Open

False positives on dropped bridge method forwarders #388

dwijnand opened this issue Sep 18, 2019 · 0 comments

Comments

@dwijnand
Copy link
Collaborator

scala/scala#6531 for Scala 2.13.0 and its backport scala/scala#7469 for Scala 2.12.8 causes MiMa users that upgrade Scala versions to get false positive problems like this (from https://travis-ci.org/twitter/algebird/jobs/586131912):

[error]  * static method one()java.lang.Object in class com.twitter.algebird.JFloatRing does not have a correspondent in current version
[error]    filter with: ProblemFilters.exclude[DirectMissingMethodProblem]("com.twitter.algebird.JFloatRing.one")
[error]  * static method zero()java.lang.Object in class com.twitter.algebird.JFloatRing does not have a correspondent in current version
[error]    filter with: ProblemFilters.exclude[DirectMissingMethodProblem]("com.twitter.algebird.JFloatRing.zero")

Here's a summary of the change. Given:

class A[T] {
  def get: T = ???
}

object T extends A[String] {
  override def get: String = "hi"
}

the class that extends A has the method

public get()Ljava/lang/String;

and also the bridge method

public bridge get()Ljava/lang/Object;

that calls the previous method.

But given T is an object it also gets a static forward for get, so it can be called from Java. Previously it was forwarding both methods, now it's only forwarding the one that's actually ever used.

MiMa could also handle this case by not emitting a problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

1 participant