Skip to content

Subclasses of Scala 3 classes falsely flagged as missing implementations #13122

@jadenPete

Description

@jadenPete

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions