Skip to content

Member not found for enum subtypes omits the ".type" part #6724

@kubukoz

Description

@kubukoz

minimized code

enum Foo[T] {
  case Bar(s: String)
  case Baz extends Foo[Int]
}

object Main {
  def f(foo: Foo.Baz): Foo[_] = foo
}

actual result

[error] -- [E008] Member Not Found Error: /Users/kubukoz/IdeaProjects/dotty-repro/src/main/scala/Main.scala:7:17
[error] 7 |  def f(foo: Foo.Baz): Foo[_] = foo
[error]   |             ^^^^^^^
[error]   |            type Baz is not a member of object Foo - did you mean Foo.Baz?

expectation

...
type Baz is not a member of object Foo - did you mean Foo.Baz.type?
...

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:reportingError reporting including formatting, implicit suggestions, etcitype:bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions