@@ -12,6 +12,7 @@ import config.Printers.{typr, constr, subtyping, noPrinter}
1212import TypeErasure .{erasedLub , erasedGlb }
1313import TypeApplications ._
1414import scala .util .control .NonFatal
15+ import reporting .trace
1516
1617/** Provides methods to compare types.
1718 */
@@ -105,7 +106,7 @@ class TypeComparer(initctx: Context) extends DotClass with ConstraintHandling {
105106 assert(isSatisfiable, constraint.show)
106107 }
107108
108- protected def isSubType (tp1 : Type , tp2 : Type ): Boolean = ctx.traceIndented (s " isSubType ${traceInfo(tp1, tp2)}" , subtyping) {
109+ protected def isSubType (tp1 : Type , tp2 : Type ): Boolean = trace (s " isSubType ${traceInfo(tp1, tp2)}" , subtyping) {
109110 if (tp2 eq NoType ) false
110111 else if (tp1 eq tp2) true
111112 else {
@@ -948,7 +949,7 @@ class TypeComparer(initctx: Context) extends DotClass with ConstraintHandling {
948949 * rebase both itself and the member info of `tp` on a freshly created skolem type.
949950 */
950951 protected def hasMatchingMember (name : Name , tp1 : Type , tp2 : RefinedType ): Boolean =
951- /* >|>*/ ctx.traceIndented (i " hasMatchingMember( $tp1 . $name :? ${tp2.refinedInfo}), mbr: ${tp1.member(name).info}" , subtyping) /* <|<*/ {
952+ /* >|>*/ trace (i " hasMatchingMember( $tp1 . $name :? ${tp2.refinedInfo}), mbr: ${tp1.member(name).info}" , subtyping) /* <|<*/ {
952953 val rinfo2 = tp2.refinedInfo
953954
954955 // If the member is an abstract type, compare the member itself
@@ -1159,7 +1160,7 @@ class TypeComparer(initctx: Context) extends DotClass with ConstraintHandling {
11591160 /** Same as `isSameType` but also can be applied to overloaded TermRefs, where
11601161 * two overloaded refs are the same if they have pairwise equal alternatives
11611162 */
1162- def isSameRef (tp1 : Type , tp2 : Type ): Boolean = ctx.traceIndented (s " isSameRef( $tp1, $tp2" ) {
1163+ def isSameRef (tp1 : Type , tp2 : Type ): Boolean = trace (s " isSameRef( $tp1, $tp2" ) {
11631164 def isSubRef (tp1 : Type , tp2 : Type ): Boolean = tp1 match {
11641165 case tp1 : TermRef if tp1.isOverloaded =>
11651166 tp1.alternatives forall (isSubRef(_, tp2))
@@ -1175,7 +1176,7 @@ class TypeComparer(initctx: Context) extends DotClass with ConstraintHandling {
11751176 }
11761177
11771178 /** The greatest lower bound of two types */
1178- def glb (tp1 : Type , tp2 : Type ): Type = /* >|>*/ ctx.traceIndented (s " glb( ${tp1.show}, ${tp2.show}) " , subtyping, show = true ) /* <|<*/ {
1179+ def glb (tp1 : Type , tp2 : Type ): Type = /* >|>*/ trace (s " glb( ${tp1.show}, ${tp2.show}) " , subtyping, show = true ) /* <|<*/ {
11791180 if (tp1 eq tp2) tp1
11801181 else if (! tp1.exists) tp2
11811182 else if (! tp2.exists) tp1
@@ -1224,7 +1225,7 @@ class TypeComparer(initctx: Context) extends DotClass with ConstraintHandling {
12241225 * @param canConstrain If true, new constraints might be added to simplify the lub.
12251226 * @note We do not admit singleton types in or-types as lubs.
12261227 */
1227- def lub (tp1 : Type , tp2 : Type , canConstrain : Boolean = false ): Type = /* >|>*/ ctx.traceIndented (s " lub( ${tp1.show}, ${tp2.show}, canConstrain= $canConstrain) " , subtyping, show = true ) /* <|<*/ {
1228+ def lub (tp1 : Type , tp2 : Type , canConstrain : Boolean = false ): Type = /* >|>*/ trace (s " lub( ${tp1.show}, ${tp2.show}, canConstrain= $canConstrain) " , subtyping, show = true ) /* <|<*/ {
12281229 if (tp1 eq tp2) tp1
12291230 else if (! tp1.exists) tp1
12301231 else if (! tp2.exists) tp2
@@ -1383,7 +1384,7 @@ class TypeComparer(initctx: Context) extends DotClass with ConstraintHandling {
13831384 *
13841385 * In these cases, a MergeError is thrown.
13851386 */
1386- final def andType (tp1 : Type , tp2 : Type , erased : Boolean = ctx.erasedTypes) = ctx.traceIndented (s " glb( ${tp1.show}, ${tp2.show}) " , subtyping, show = true ) {
1387+ final def andType (tp1 : Type , tp2 : Type , erased : Boolean = ctx.erasedTypes) = trace (s " glb( ${tp1.show}, ${tp2.show}) " , subtyping, show = true ) {
13871388 val t1 = distributeAnd(tp1, tp2)
13881389 if (t1.exists) t1
13891390 else {
0 commit comments