From bd3ee3076b653c35acf6d61073e53c57fd09bb24 Mon Sep 17 00:00:00 2001 From: Natsu Kagami Date: Tue, 7 May 2024 15:20:44 +0200 Subject: [PATCH] Remove redundant cases with UnApply --- .../src/main/dotty/tools/pc/completions/Completions.scala | 2 ++ .../dotty/tools/pc/tests/completion/CompletionSuite.scala | 5 ----- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/presentation-compiler/src/main/dotty/tools/pc/completions/Completions.scala b/presentation-compiler/src/main/dotty/tools/pc/completions/Completions.scala index 9d53404f6146..37cc86792e31 100644 --- a/presentation-compiler/src/main/dotty/tools/pc/completions/Completions.scala +++ b/presentation-compiler/src/main/dotty/tools/pc/completions/Completions.scala @@ -68,6 +68,8 @@ class Completions( false case (_: (Import | Export)) :: _ => false case _ :: (_: (Import | Export)) :: _ => false + // UnApply has patterns included in MatchCaseCompletions + case _ :: (_: UnApply) :: _ => false case _ => true private lazy val isNew: Boolean = diff --git a/presentation-compiler/test/dotty/tools/pc/tests/completion/CompletionSuite.scala b/presentation-compiler/test/dotty/tools/pc/tests/completion/CompletionSuite.scala index 4e32d9e2ac5f..cf2d7bb5bb00 100644 --- a/presentation-compiler/test/dotty/tools/pc/tests/completion/CompletionSuite.scala +++ b/presentation-compiler/test/dotty/tools/pc/tests/completion/CompletionSuite.scala @@ -642,7 +642,6 @@ class CompletionSuite extends BaseCompletionSuite: |} |""".stripMargin, """|Some(value) scala - |Some[A](value: A): Some[A] |Some scala |""".stripMargin ) @@ -653,7 +652,6 @@ class CompletionSuite extends BaseCompletionSuite: |} |""".stripMargin, """|Some(value) scala - |Some[A](value: A): Some[A] |Some scala |""".stripMargin ) @@ -664,7 +662,6 @@ class CompletionSuite extends BaseCompletionSuite: |} |""".stripMargin, """|Some(value) scala - |Some[A](value: A): Some[A] |Some scala |""".stripMargin ) @@ -676,7 +673,6 @@ class CompletionSuite extends BaseCompletionSuite: | case Some(Test.Neste@@) |""".stripMargin, """|NestedClass(x) test.Test - |NestedClass(x: Int): NestedClass |NestedClass test.Test |""".stripMargin ) @@ -690,7 +686,6 @@ class CompletionSuite extends BaseCompletionSuite: |""".stripMargin, """|Some(value) scala |Some scala - |Some[A](value: A): Some[A] |Some scala |""".stripMargin )