Skip to content

Commit 67e6505

Browse files
committed
Add more tests for deeply nested patterns and patterns with Select instead of Ident
1 parent 433a897 commit 67e6505

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

presentation-compiler/test/dotty/tools/pc/tests/completion/CompletionSuite.scala

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -646,6 +646,17 @@ class CompletionSuite extends BaseCompletionSuite:
646646
|Some scala
647647
|""".stripMargin
648648
)
649+
check(
650+
s"""|object Main {
651+
| (null: Option[Option[Option[Option[Int]]]]) match
652+
| case Some(Some(Some(Som@@))))
653+
|}
654+
|""".stripMargin,
655+
"""|Some(value) scala
656+
|Some[A](value: A): Some[A]
657+
|Some scala
658+
|""".stripMargin
659+
)
649660
check(
650661
s"""|object Main {
651662
| Option(Option(1)) match {
@@ -657,6 +668,18 @@ class CompletionSuite extends BaseCompletionSuite:
657668
|Some scala
658669
|""".stripMargin
659670
)
671+
check(
672+
s"""|object Test:
673+
| case class NestedClass(x: Int)
674+
|object TestRun:
675+
| Option(Test.NestedClass(5)) match
676+
| case Some(Test.Neste@@)
677+
|""".stripMargin,
678+
"""|NestedClass(x) test.Test
679+
|NestedClass(x: Int): NestedClass
680+
|NestedClass test.Test
681+
|""".stripMargin
682+
)
660683

661684
@Test def pat1 =
662685
check(

0 commit comments

Comments
 (0)