File tree 2 files changed +6
-4
lines changed
compiler/src/dotty/tools/dotc/transform/patmat
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 {
659
659
case and : AndType => canDecompose(and.tp1) || canDecompose(and.tp2)
660
660
case _ =>
661
661
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
666
663
|| cls.isAllOf(JavaEnumTrait )
667
664
|| tp.isRef(defn.BooleanClass )
668
665
|| tp.isRef(defn.UnitClass )
@@ -846,6 +843,9 @@ class SpaceEngine(using Context) extends SpaceLogic {
846
843
847
844
if (! exhaustivityCheckable(sel)) return
848
845
846
+ debug.println(" checking " + _match.show)
847
+ debug.println(" selTyp = " + selTyp.show)
848
+
849
849
val patternSpace = Or (cases.foldLeft(List .empty[Space ]) { (acc, x) =>
850
850
val space = if (x.guard.isEmpty) project(x.pat) else Empty
851
851
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