Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/transform/patmat/Space.scala
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,7 @@ object SpaceEngine {
// Case unapplySeq:
// 1. return the type `List[T]` where `T` is the element type of the unapplySeq return type `Seq[T]`

val resTp = wildApprox(ctx.typeAssigner.safeSubstMethodParams(mt, scrutineeTp :: Nil).finalResultType)
val resTp = wildApprox(ctx.typeAssigner.safeSubstMethodParams(mt, scrutineeTp :: Nil).finalResultType).stripNamedTuple

val sig =
if (resTp.isRef(defn.BooleanClass))
Expand Down
11 changes: 11 additions & 0 deletions tests/pos/i23158.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
//> using options -Werror

object Unpack {
final case class Pair(a: Int, b: Int)
def unapply(e: Pair): NamedTuple.NamedTuple[("a", "b"), (Int, Int)] = ???

val x: Pair = ???
x match {
case Unpack(_, _) => ???
}
}
Loading