bug icon indicating copy to clipboard operation
bug copied to clipboard

False "cannot override a concrete member" error when referencing Scala 3 code

Open jadenPete opened this issue 2 months ago • 0 comments

Reproduction steps

Scala 2 version: 2.13.16 Scala 3 version: 3.7.3

  1. Clone this minimum reproducability case: https://github.com/jadenPete/scala-cannot-override-bug-reproduction
  2. Run sbt compile
  3. Observe the following compilation error:
[error] .../scala2/src/main/scala/Buzz.scala:1:7: cannot override a concrete member without a third member that's overridden by both (this rule is designed to prevent accidental overrides)
[error] implicit val bar: Int (defined in trait Bar)
[error]   with override val bar: Int (defined in trait Bizz)
[error] trait Buzz extends Foo with Bizz
[error]       ^
[error] one error found

Problem

When both projects are compiled with either Scala 2 or 3, this error doesn't occur. That, and the fact that this error doesn't occur when the Foo self type is removed, lead me to believe this is a bug, not expected behavior. Please correct me if I'm wrong.

jadenPete avatar Oct 24 '25 23:10 jadenPete