Skip to content

Type member in subclass should shadow type member in owner #11953

Closed
@japgolly

Description

@japgolly

Compiler version

3.0.0-RC1

Minimized code

trait X { type M = Int }

object Y {
  type M = String

  class C extends X {
    def m: M = 123
  }
}

Output

7 |    def m: M = 123
  |           ^
  |           Reference to M is ambiguous,
  |           it is both defined in object Y
  |           and inherited subsequently in class C

Expectation

It should compile. (It does in Scala 2.x)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions