File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
compiler/src/dotty/tools/dotc/transform/patmat Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -476,11 +476,12 @@ class SpaceEngine(implicit ctx: Context) extends SpaceLogic {
476
476
477
477
/** Abstract sealed types, or-types, Boolean and Java enums can be decomposed */
478
478
def canDecompose (tp : Type ): Boolean = {
479
+ val dealiasedTp = tp.dealias
479
480
val res = tp.classSymbol.is(allOf(Abstract , Sealed )) ||
480
481
tp.classSymbol.is(allOf(Trait , Sealed )) ||
481
- tp.dealias .isInstanceOf [OrType ] ||
482
- (tp .isInstanceOf [AndType ] && {
483
- val and = tp .asInstanceOf [AndType ]
482
+ dealiasedTp .isInstanceOf [OrType ] ||
483
+ (dealiasedTp .isInstanceOf [AndType ] && {
484
+ val and = dealiasedTp .asInstanceOf [AndType ]
484
485
canDecompose(and.tp1) || canDecompose(and.tp2)
485
486
}) ||
486
487
tp =:= ctx.definitions.BooleanType ||
You can’t perform that action at this time.
0 commit comments