bug icon indicating copy to clipboard operation
bug copied to clipboard

Subclasses of Scala 3 classes falsely flagged as missing implementations

Open jadenPete opened this issue 3 months ago • 0 comments

Reproduction steps

Scala 2 version: 2.13.16 Scala 3 version: 3.6.3

  1. Clone this minimum reproducability case: https://github.com/jadenPete/scala-missing-implementation-bug-reproduction

  2. Run sbt compile

  3. Observe the following compilation error:

[error] .../human/src/main/scala/Human.scala:1:7: class Human needs to be abstract.
[error] Missing implementation for member of trait Mammal:
[error]   def name: String = ???
[error] class Human extends Mammal
[error]       ^
[error] one error found

Problem

I'd expect this to compile. Although Mammal doesn't provide a "concrete" implementation of name because its implementation relies on the superclass's (Animal) name, the superclass does define name. This builds if both projects are compiled with Scala 2, which leads me to believe this is an issue with Scala 2's TASTy reader.

jadenPete avatar Sep 19 '25 18:09 jadenPete