File tree Expand file tree Collapse file tree 3 files changed +13
-2
lines changed
compiler/src/dotty/tools/dotc/transform/patmat Expand file tree Collapse file tree 3 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -481,8 +481,8 @@ class SpaceEngine(implicit ctx: Context) extends SpaceLogic {
481
481
def projectSeq (pats : List [Tree ]): Space = {
482
482
if (pats.isEmpty) return Typ (scalaNilType, false )
483
483
484
- val (items, zero) = if (pats.last.tpe.isRepeatedParam )
485
- (pats.init, Typ (scalaListType.appliedTo(pats.last.tpe.argTypes.head ), false ))
484
+ val (items, zero) = if (isWildcardStarArg( pats.last) )
485
+ (pats.init, Typ (scalaListType.appliedTo(pats.last.tpe.elemType ), false ))
486
486
else
487
487
(pats, Typ (scalaNilType, false ))
488
488
Original file line number Diff line number Diff line change
1
+ 8: Pattern Match Exhaustivity: C()
Original file line number Diff line number Diff line change
1
+ sealed trait T
2
+
3
+ case class C (xs : Int * ) extends T
4
+
5
+ def f (): Unit = (C (42 ): T ) match { case C (xs : _* ) => }
6
+ def g (): Unit = (C (42 ): T ) match { case C (_ : _* ) => }
7
+
8
+ def h (): Unit = (C (42 ): T ) match
9
+ case C (5 , _ : _* ) =>
10
+ case C (x, xs : _* ) =>
You can’t perform that action at this time.
0 commit comments