Skip to content

Wrong linearization for super calls in case classes #17555

Closed
@ddtthh

Description

@ddtthh

Compiler version

3.2.2
3.3.0-RC3
Worked in 3.1.2

Minimized code

class Root {
  override def toString() = "Root"
}
trait A extends Root with B {  }
trait B {
   override def toString() = "B"
}
case class C() extends A {
  override def toString() = super.toString()
}

println(C())

Output

Root

Expectation

toString in trait B should be called and output should be B.
This works for normal classes, but the case class breaks that.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions