Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
kubukoz opened this issue Jun 21, 2019 · 0 comments
Closed

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

kubukoz opened this issue Jun 21, 2019 · 0 comments
Labels
area:reporting Error reporting including formatting, implicit suggestions, etc itype:bug

Comments

@kubukoz
Copy link
Contributor

kubukoz commented Jun 21, 2019

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?
...
@smarter smarter added the area:reporting Error reporting including formatting, implicit suggestions, etc label Jun 21, 2019
odersky added a commit that referenced this issue Jun 24, 2019
Fix #6724: Don't suggest types for terms and vice versa
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:reporting Error reporting including formatting, implicit suggestions, etc itype:bug
Projects
None yet
Development

No branches or pull requests

2 participants