lightbend-labs / mima

A tool for catching binary incompatibility in Scala
Apache License 2.0
459 stars 71 forks source link

False positive related to static forwarders #433

Open jrudolph opened 4 years ago

jrudolph commented 4 years ago

We were seeing a similar issue as #388 in akka/akka#28294. When we added overloads to methods that got extra forwarders generated in previous versions compiled with a previous Scala 2.12 version, these were flagged by mima as incompatibilities:

Akka 2.5.17:

λ javap -classpath ~/.ivy2/cache/com.typesafe.akka/akka-actor_2.12/jars/akka-actor_2.12-2.5.17.jar akka.actor.CoordinatedShutdown|grep get
  public static akka.actor.CoordinatedShutdown get(akka.actor.ActorSystem);
  public static akka.actor.Extension get(akka.actor.ActorSystem);

Akka 2.5.19:

λ javap -classpath ~/.ivy2/cache/com.typesafe.akka/akka-actor_2.12/jars/akka-actor_2.12-2.5.19.jar akka.actor.CoordinatedShutdown|grep get
  public static akka.actor.CoordinatedShutdown get(akka.actor.ActorSystem);

Now we actually added another overload and got this:

λ javap -classpath akka-actor/target-java-1.8.0_232/scala-2.12/classes/  akka.actor.CoordinatedShutdown|grep get
  public static akka.actor.CoordinatedShutdown get(akka.actor.ClassicActorSystemProvider);
  public static akka.actor.CoordinatedShutdown get(akka.actor.ActorSystem);

and this mima error (against the 2.5.17 version) which doesn't make much sense:

[error]  * static method get(akka.actor.ActorSystem)akka.actor.Extension in class akka.actor.CoordinatedShutdown has a different result type in current version, where it is akka.actor.CoordinatedShutdown rather than akka.actor.Extension
SethTisue commented 2 years ago

is this just a duplicate of #388?