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
1 change: 1 addition & 0 deletions compiler/src/dotty/tools/dotc/transform/patmat/Space.scala
Original file line number Diff line number Diff line change
Expand Up @@ -702,6 +702,7 @@ object SpaceEngine {
case OrType(tp1, tp2) => inhabited(tp1) || inhabited(tp2)
case tp: RefinedType => inhabited(tp.parent)
case tp: TypeRef => !containsUninhabitedField(tp) && inhabited(tp.prefix)
case tp: AppliedType => !containsUninhabitedField(tp) && inhabited(tp.tycon)
case _ => !containsUninhabitedField(tp)

if inhabited(refined) then refined
Expand Down
18 changes: 18 additions & 0 deletions tests/pos/i23734.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
trait Nodes1 {
sealed trait B
final case class R1() extends B
}

trait Nodes2 extends Nodes1 {
final case class R2[T]() extends B
}


object Impl1 extends Nodes1

object test2 {
val a: Impl1.B = ???
a match {
case Impl1.R1() => ???
}
}
Loading