Skip to content
Merged
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
5 changes: 1 addition & 4 deletions compiler/src/dotty/tools/dotc/transform/patmat/Space.scala
Original file line number Diff line number Diff line change
Expand Up @@ -354,11 +354,8 @@ class SpaceEngine(using Context) extends SpaceLogic {
case pat: Ident if isBackquoted(pat) =>
Typ(pat.tpe, decomposed = false)

case Ident(nme.WILDCARD) =>
Typ(erase(pat.tpe.stripAnnots, isValue = true), decomposed = false)

case Ident(_) | Select(_, _) =>
Typ(erase(pat.tpe.stripAnnots, isValue = true), decomposed = false)
Typ(erase(pat.tpe.stripAnnots.widenSkolem, isValue = true), decomposed = false)

case Alternative(trees) =>
Or(trees.map(project(_)))
Expand Down
12 changes: 12 additions & 0 deletions tests/patmat/i13110.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
object Test {
sealed trait Base
class Blub extends Base
object Blub {
def unapply(blub: Blub): Some[(Int, blub.type)] =
Some(1 -> blub)
}

(null: Base) match {
case Blub(i, x) => println(i)
}
}