From 095f37a975c73b4c2d0d1f7b272a52e19904752a Mon Sep 17 00:00:00 2001 From: Rikito Taniguchi Date: Wed, 13 Apr 2022 20:12:07 +0900 Subject: [PATCH] test: Add test for completions of matchtype / higher-kinded type https://github.com/scalameta/metals/issues/2810 --- .../tests/pc/CompletionScala3Suite.scala | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/tests/cross/src/test/scala/tests/pc/CompletionScala3Suite.scala b/tests/cross/src/test/scala/tests/pc/CompletionScala3Suite.scala index 96a43ec66d5..b16865871c9 100644 --- a/tests/cross/src/test/scala/tests/pc/CompletionScala3Suite.scala +++ b/tests/cross/src/test/scala/tests/pc/CompletionScala3Suite.scala @@ -21,4 +21,25 @@ class CompletionScala3Suite extends BaseCompletionSuite { |""".stripMargin, topLines = Some(2) ) + + // https://github.com/scalameta/metals/issues/2810 + check( + "higher-kinded-match-type".tag(IgnoreScalaVersion.forLessThan("3.1.3-RC2")), + """|package a + | + |trait Foo[A] { + | def map[B](f: A => B): Foo[B] = ??? + |} + |case class Bar[F[_]](bar: F[Int]) + |type M[T] = T match { + | case Int => Foo[Int] + |} + |object Test: + | val x = Bar[M](new Foo[Int]{}) + | x.bar.m@@ + |""".stripMargin, + """|map[B](f: A => B): Foo[B] + |""".stripMargin, + topLines = Some(1) + ) }