@@ -400,21 +400,21 @@ class SpaceEngine(implicit ctx: Context) extends SpaceLogic {
400400
401401 val sig =
402402 if (isSyntheticScala2Unapply(unappSym) && caseAccessors.length == argLen)
403- caseAccessors.map(_.info.asSeenFrom(mt.paramInfos.head, caseClass).widen )
403+ caseAccessors.map(_.info.asSeenFrom(mt.paramInfos.head, caseClass).widenExpr )
404404 else if (mt.finalResultType.isRef(defn.BooleanClass ))
405405 List ()
406406 else {
407407 val isUnapplySeq = unappSym.name == nme.unapplySeq
408408 if (isProductMatch(mt.finalResultType, argLen) && ! isUnapplySeq) {
409409 productSelectors(mt.finalResultType).take(argLen)
410- .map(_.info.asSeenFrom(mt.finalResultType, mt.resultType.classSymbol).widen )
410+ .map(_.info.asSeenFrom(mt.finalResultType, mt.resultType.classSymbol).widenExpr )
411411 }
412412 else {
413413 val resTp = mt.finalResultType.select(nme.get).finalResultType.widen
414414 if (isUnapplySeq) scalaListType.appliedTo(resTp.argTypes.head) :: Nil
415415 else if (argLen == 0 ) Nil
416416 else if (isProductMatch(resTp, argLen))
417- productSelectors(resTp).map(_.info.asSeenFrom(resTp, resTp.classSymbol).widen )
417+ productSelectors(resTp).map(_.info.asSeenFrom(resTp, resTp.classSymbol).widenExpr )
418418 else resTp :: Nil
419419 }
420420 }
@@ -443,6 +443,8 @@ class SpaceEngine(implicit ctx: Context) extends SpaceLogic {
443443 Typ (ConstantType (Constant (true )), true ),
444444 Typ (ConstantType (Constant (false )), true )
445445 )
446+ case tp if tp.isRef(defn.UnitClass ) =>
447+ Typ (ConstantType (Constant (())), true ) :: Nil
446448 case tp if tp.classSymbol.is(Enum ) =>
447449 children.map(sym => Typ (sym.termRef, true ))
448450 case tp =>
@@ -708,6 +710,7 @@ class SpaceEngine(implicit ctx: Context) extends SpaceLogic {
708710 canDecompose(and.tp1) || canDecompose(and.tp2)
709711 }) ||
710712 tp.isRef(defn.BooleanClass ) ||
713+ tp.isRef(defn.UnitClass ) ||
711714 tp.classSymbol.is(allOf(Enum , Sealed )) // Enum value doesn't have Sealed flag
712715
713716 debug.println(s " decomposable: ${tp.show} = $res" )
0 commit comments