Closed
Description
As in title, some refined types are not handled in SpaceEngine#expose
:
sealed trait S
object O extends S
trait T
def m(s: S { val x: Int }) = s match { case _: T => ; }
Compiling this prints the trees being transformed + this error message:
Exception in thread "main" scala.MatchError: TypeRef(TermRef(ThisType(TypeRef(NoPrefix,<root>)),scala)/withSig(Signature(List(),)),Int) (of class dotty.tools.dotc.core.Types$CachedTypeRef)
at dotty.tools.dotc.transform.patmat.SpaceEngine.expose(Space.scala:520)
at dotty.tools.dotc.transform.patmat.SpaceEngine$$anonfun$27.apply(Space.scala:349)
at dotty.tools.dotc.transform.patmat.SpaceEngine$$anonfun$27.apply(Space.scala:346)
at scala.collection.TraversableLike$$anonfun$filterImpl$1.apply(TraversableLike.scala:259)
at scala.collection.immutable.List.foreach(List.scala:381)
at scala.collection.TraversableLike$class.filterImpl(TraversableLike.scala:258)
at scala.collection.TraversableLike$class.filter(TraversableLike.scala:270)
at scala.collection.AbstractTraversable.filter(Traversable.scala:104)
at dotty.tools.dotc.transform.patmat.SpaceEngine.decompose(Space.scala:346)
at dotty.tools.dotc.transform.patmat.SpaceLogic$class.tryDecompose1$3(Space.scala:198)
at dotty.tools.dotc.transform.patmat.SpaceLogic$class.minus(Space.scala:206)
at dotty.tools.dotc.transform.patmat.SpaceEngine.minus(Space.scala:243)
at dotty.tools.dotc.transform.patmat.SpaceEngine.checkExhaustivity(Space.scala:555)