Skip to content

Commit fb93fe7

Browse files
committed
Also fix inside Some
1 parent ece0a5f commit fb93fe7

File tree

4 files changed

+23
-1
lines changed

4 files changed

+23
-1
lines changed

compiler/src/dotty/tools/dotc/transform/patmat/Space.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -602,7 +602,7 @@ object SpaceEngine {
602602
if (arity > 0)
603603
productSelectorTypes(resTp, unappSym.srcPos)
604604
else {
605-
val getTp = extractorMemberType(resTp, nme.get, unappSym.srcPos)
605+
val getTp = extractorMemberType(resTp, nme.get, unappSym.srcPos).stripNamedTuple
606606
if (argLen == 1) getTp :: Nil
607607
else productSelectorTypes(getTp, unappSym.srcPos)
608608
}
File renamed without changes.

tests/pos/i23158b.scala

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
//> using options -Werror
2+
3+
object Unpack {
4+
final case class Pair(a: Int, b: Int)
5+
def unapply(e: Pair): (a: Int, b: Int) = ???
6+
7+
val x: Pair = ???
8+
x match {
9+
case Unpack(_, _) => ???
10+
}
11+
}

tests/pos/i23158c.scala

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
//> using options -Werror
2+
3+
object Unpack {
4+
final case class Pair(a: Int, b: Int)
5+
def unapply(e: Pair): Some[(a: Int, b: Int)] = ???
6+
7+
val x: Pair = ???
8+
x match {
9+
case Unpack(_, _) => ???
10+
}
11+
}

0 commit comments

Comments
 (0)