Skip to content

False positive InheritedNewAbstractMethodProblem? #807

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
clee704 opened this issue Apr 19, 2024 · 0 comments · May be fixed by #806
Open

False positive InheritedNewAbstractMethodProblem? #807

clee704 opened this issue Apr 19, 2024 · 0 comments · May be fixed by #806

Comments

@clee704
Copy link

clee704 commented Apr 19, 2024

Before working on this issue, I'd like to check if I'm missing something.

Version 1:

trait A {
  def foo(a: Int) = println(s"A.foo $a")
}
trait B extends A

Version 2:

trait A {
  def foo(a: Int) = println(s"A.foo $a")
}
trait AA extends A {
  override def foo(a: Int) = {
    if (a > 0) {
      println(s"AA.foo $a")
    } else {
      super.foo(a)
    }
  }
}
trait B extends AA

App:

object App {
  def main(args: Array[String]): Unit = {
    val b = new B {}
    b.foo(1)
    b.foo(-1)
  }
}

I think this is a false positive, but MiMa gives abstract synthetic method AA$$super$foo(Int)Unit in interface AA is inherited by class B in new version..

@clee704 clee704 linked a pull request Apr 25, 2024 that will close this issue
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

1 participant