@@ -167,7 +167,7 @@ trait SpaceLogic {
167167 def tryDecompose1 (tp : Type ) = canDecompose(tp) && isSubspace(Or (decompose(tp)), b)
168168 def tryDecompose2 (tp : Type ) = canDecompose(tp) && isSubspace(a, Or (decompose(tp)))
169169
170- (simplify(a), b ) match {
170+ (simplify(a), simplify(b) ) match {
171171 case (Empty , _) => true
172172 case (_, Empty ) => false
173173 case (Or (ss), _) =>
@@ -728,6 +728,7 @@ class SpaceEngine(implicit ctx: Context) extends SpaceLogic {
728728 checkConstraint(genConstraint(sp))(ctx.fresh.setNewTyperState())
729729 }
730730
731+ def show (ss : Seq [Space ]): String = ss.map(show).mkString(" , " )
731732 /** Display spaces */
732733 def show (s : Space ): String = {
733734 def params (tp : Type ): List [Type ] = tp.classSymbol.primaryConstructor.info.firstParamTypes
@@ -740,7 +741,7 @@ class SpaceEngine(implicit ctx: Context) extends SpaceLogic {
740741 }
741742
742743 def doShow (s : Space , flattenList : Boolean = false ): String = s match {
743- case Empty => " "
744+ case Empty => " empty "
744745 case Typ (c : ConstantType , _) => " " + c.value.value
745746 case Typ (tp : TermRef , _) =>
746747 if (flattenList && tp <:< scalaNilType) " "
@@ -773,11 +774,11 @@ class SpaceEngine(implicit ctx: Context) extends SpaceLogic {
773774 val paramsStr = params.map(doShow(_, flattenList = isUnapplySeq)).mkString(" (" , " , " , " )" )
774775 showType(fun.prefix) + paramsStr
775776 }
776- case Or (_ ) =>
777- throw new Exception ( " incorrect flatten result " + s )
777+ case Or (ss ) =>
778+ ss.map(doShow(_, flattenList)).mkString( " | " )
778779 }
779780
780- flatten(s).map( doShow(_ , flattenList = false )).distinct.mkString( " , " )
781+ doShow(s , flattenList = false )
781782 }
782783
783784 private def exhaustivityCheckable (sel : Tree ): Boolean = {
@@ -831,7 +832,7 @@ class SpaceEngine(implicit ctx: Context) extends SpaceLogic {
831832 }
832833
833834 if (uncovered.nonEmpty)
834- ctx.warning(PatternMatchExhaustivity (show(Or ( uncovered) )), sel.sourcePos)
835+ ctx.warning(PatternMatchExhaustivity (show(uncovered)), sel.sourcePos)
835836 }
836837
837838 private def redundancyCheckable (sel : Tree ): Boolean =
0 commit comments