scala / bug

Scala 2 bug reports only. Please, no questions — proper bug reports only.
https://scala-lang.org
230 stars 21 forks source link

Spurious "nullary overrides nilary" warning involving Java #12858

Closed lrytz closed 10 months ago

lrytz commented 10 months ago
interface A {
  int f();
}
trait B1 extends A { def f: Int }
trait C1 { def f = 2 }
class T1 extends B1 with C1

trait B2 extends A { def f: Int = 1}
trait C2 { self: B2 => override def f = 2 }
class T2 extends B2 with C2

There are spurious warnings at T1 and T2 with 2.13.12-bin-f7e30a6, the 2.13.12 RC:

➜ sandbox qsc A.java B.scala
B.scala:3: warning: method f in trait C1 defined without a parameter list overrides method f in trait B1 defined with a single empty parameter list [quickfixable]
class T1 extends B1 with C1
      ^
B.scala:7: warning: method f in trait C2 defined without a parameter list overrides method f in trait B2 defined with a single empty parameter list [quickfixable]
class T2 extends B2 with C2
      ^
2 warnings

I'll submit a PR.