Skip to content

Error with super accessors #15702

Closed
@liufengyun

Description

@liufengyun

Compiler version

master and 3.1.3

Minimized code

abstract class A:
  val n: Int
  def foo(): Int = n

trait B:
  val m: Int
  def foo(): Int = m

trait M extends A with B:
  val a: Int
  override def foo(): Int = a + super.foo()

trait N extends A with B:
  val b: Int
  override def foo(): Int = b * super.foo()

  class Inner:
    N.super[A].foo()
    N.super.foo()

class C extends A with M with N:
  new Inner()
  val a = 10 // error
  val b = 20 // error
  val m = 30 // error
  val n = 40

Output

-- Error: examples/super.scala:21:6 --------------------------------------------
21 |class C extends A with M with N:
   |      ^
   |Member method foo$A of mixin trait N is missing a concrete super implementation in class C.

Expectation

It should compile without errors as in Scala 2.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions