@@ -210,7 +210,7 @@ class TypeComparer(@constructorOnly initctx: Context) extends ConstraintHandling
210210 * types (as when we go from an abstract type to one of its bounds). In that case
211211 * one should use `isSubType(_, _, a)` where `a` defines the kind of approximation.
212212 *
213- * Note: Logicaly , `recur` could be nested in `isSubType`, which would avoid
213+ * Note: Logically , `recur` could be nested in `isSubType`, which would avoid
214214 * the instance state consisting `approx` and `leftRoot`. But then the implemented
215215 * code would have two extra parameters for each of the many calls that go from
216216 * one sub-part of isSubType to another.
@@ -2955,27 +2955,24 @@ class ExplainingTypeComparer(initctx: Context) extends TypeComparer(initctx) {
29552955 if (skipped) op
29562956 else {
29572957 indent += 2
2958- b.append(" \n " ).append(" " * indent).append(" ==> " ).append(str)
2958+ val str1 = str.replace('\n ' , ' ' )
2959+ b.append(" \n " ).append(" " * indent).append(" ==> " ).append(str1)
29592960 val res = op
2960- b.append(" \n " ).append(" " * indent).append(" <== " ).append(str ).append(" = " ).append(show(res))
2961+ b.append(" \n " ).append(" " * indent).append(" <== " ).append(str1 ).append(" = " ).append(show(res))
29612962 indent -= 2
29622963 res
29632964 }
29642965
29652966 private def frozenNotice : String =
29662967 if frozenConstraint then " in frozen constraint" else " "
29672968
2968- override def isSubType (tp1 : Type , tp2 : Type , approx : ApproxState ): Boolean =
2969+ override def recur (tp1 : Type , tp2 : Type ): Boolean =
29692970 def moreInfo =
29702971 if Config .verboseExplainSubtype || ctx.settings.verbose.value
29712972 then s " ${tp1.getClass} ${tp2.getClass}"
29722973 else " "
2974+ val approx = approxState
29732975 traceIndented(s " ${show(tp1)} <: ${show(tp2)}$moreInfo${approx.show}$frozenNotice" ) {
2974- super .isSubType(tp1, tp2, approx)
2975- }
2976-
2977- override def recur (tp1 : Type , tp2 : Type ): Boolean =
2978- traceIndented(s " ${show(tp1)} <: ${show(tp2)} (recurring) $frozenNotice" ) {
29792976 super .recur(tp1, tp2)
29802977 }
29812978
@@ -2995,7 +2992,7 @@ class ExplainingTypeComparer(initctx: Context) extends TypeComparer(initctx) {
29952992 }
29962993
29972994 override def addConstraint (param : TypeParamRef , bound : Type , fromBelow : Boolean )(using Context ): Boolean =
2998- traceIndented(i " add constraint $param ${if (fromBelow) " >:" else " <:" } $bound $frozenConstraint , constraint = ${ctx.typerState.constraint}" ) {
2995+ traceIndented(s " add constraint ${show( param)} ${if (fromBelow) " >:" else " <:" } ${show( bound)} $frozenNotice , constraint = ${show( ctx.typerState.constraint) }" ) {
29992996 super .addConstraint(param, bound, fromBelow)
30002997 }
30012998
0 commit comments