Skip to content

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

@jadenPete

Description

@jadenPete

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions