File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed
compiler/src/dotty/tools/dotc/transform/patmat Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -659,10 +659,7 @@ class SpaceEngine(using Context) extends SpaceLogic {
659659 case and : AndType => canDecompose(and.tp1) || canDecompose(and.tp2)
660660 case _ =>
661661 val cls = tp.classSymbol
662- cls.is(Sealed )
663- && cls.isOneOf(AbstractOrTrait )
664- && ! cls.hasAnonymousChild
665- && cls.children.nonEmpty
662+ cls.is(Sealed ) && ! cls.hasAnonymousChild
666663 || cls.isAllOf(JavaEnumTrait )
667664 || tp.isRef(defn.BooleanClass )
668665 || tp.isRef(defn.UnitClass )
@@ -846,6 +843,9 @@ class SpaceEngine(using Context) extends SpaceLogic {
846843
847844 if (! exhaustivityCheckable(sel)) return
848845
846+ debug.println(" checking " + _match.show)
847+ debug.println(" selTyp = " + selTyp.show)
848+
849849 val patternSpace = Or (cases.foldLeft(List .empty[Space ]) { (acc, x) =>
850850 val space = if (x.guard.isEmpty) project(x.pat) else Empty
851851 debug.println(s " ${x.pat.show} ====> ${show(space)}" )
Original file line number Diff line number Diff line change 1+ sealed abstract class Foo [T ]
2+ object Foo extends Foo [Nothing ]
You can’t perform that action at this time.
0 commit comments