Skip to content
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

Completions, higher-kinded types and match types #2810

Closed
kubukoz opened this issue May 19, 2021 · 2 comments · Fixed by scala/scala3#14639 or #3821
Closed

Completions, higher-kinded types and match types #2810

kubukoz opened this issue May 19, 2021 · 2 comments · Fixed by scala/scala3#14639 or #3821
Assignees
Labels
bug Something that is making a piece of functionality unusable presentation-compiler Something relating to the presentation compiler Scala 3 Generic ticket relating to Scala 3 upstream-fix-needed Waiting on a fix upstream

Comments

@kubukoz
Copy link
Contributor

kubukoz commented May 19, 2021

Describe the bug

Completions don't show up on members of a higher-kinded type if it's been applied with a match type (at least with non-standard types).

To Reproduce

Steps to reproduce the behavior:

  1. Create a file with this content:
trait IO[A] {
  def map[B](f: A => B): IO[B]
}

case class User[F[_]](age: F[Int])

type M[A] = A match {
  case Int => IO[Int]
}
  1. Now add:
def demo(x: M[A]) =
  x.age

and try to run completions on .age.

Expected behavior

Seeing map in the completions

Screenshots

image

Installation:

  • Operating system: macOS
  • Editor: Visual Studio Code
  • Metals version: v0.10.3

Additional context

The methods show up if M[A] results in different types, but I'm under the impression we only see members of some supertypes. For example, List[Int]:

image

The foldLeft method on LinearSeq (the one I can navigate to) isn't deprecated - the one I see is probably from IterableOnceOps (that one is deprecated).

Search terms

match types, type matching, hkd, higher kinded data, completions

@tgodzik
Copy link
Contributor

tgodzik commented May 19, 2021

Thanks for reporting! I think match types are currently not that well supported in Dotty, we need to follow up in the compiler to see what's going on.

@tgodzik tgodzik added bug Something that is making a piece of functionality unusable presentation-compiler Something relating to the presentation compiler Scala 3 Generic ticket relating to Scala 3 upstream-fix-needed Waiting on a fix upstream labels May 19, 2021
@tanishiking
Copy link
Member

tanishiking commented Apr 13, 2022

I confirmed this is fixed by scala/scala3#14639 in the latest nightly Scala3 version (3.1.3-RC2 or newer), thanks @rochala !
I'll add a test on Metals side

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something that is making a piece of functionality unusable presentation-compiler Something relating to the presentation compiler Scala 3 Generic ticket relating to Scala 3 upstream-fix-needed Waiting on a fix upstream
Projects
None yet
3 participants