@@ -210,7 +210,7 @@ class TypeComparer(@constructorOnly initctx: Context) extends ConstraintHandling
210
210
* types (as when we go from an abstract type to one of its bounds). In that case
211
211
* one should use `isSubType(_, _, a)` where `a` defines the kind of approximation.
212
212
*
213
- * Note: Logicaly , `recur` could be nested in `isSubType`, which would avoid
213
+ * Note: Logically , `recur` could be nested in `isSubType`, which would avoid
214
214
* the instance state consisting `approx` and `leftRoot`. But then the implemented
215
215
* code would have two extra parameters for each of the many calls that go from
216
216
* one sub-part of isSubType to another.
@@ -2955,27 +2955,24 @@ class ExplainingTypeComparer(initctx: Context) extends TypeComparer(initctx) {
2955
2955
if (skipped) op
2956
2956
else {
2957
2957
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)
2959
2960
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))
2961
2962
indent -= 2
2962
2963
res
2963
2964
}
2964
2965
2965
2966
private def frozenNotice : String =
2966
2967
if frozenConstraint then " in frozen constraint" else " "
2967
2968
2968
- override def isSubType (tp1 : Type , tp2 : Type , approx : ApproxState ): Boolean =
2969
+ override def recur (tp1 : Type , tp2 : Type ): Boolean =
2969
2970
def moreInfo =
2970
2971
if Config .verboseExplainSubtype || ctx.settings.verbose.value
2971
2972
then s " ${tp1.getClass} ${tp2.getClass}"
2972
2973
else " "
2974
+ val approx = approxState
2973
2975
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" ) {
2979
2976
super .recur(tp1, tp2)
2980
2977
}
2981
2978
@@ -2995,7 +2992,7 @@ class ExplainingTypeComparer(initctx: Context) extends TypeComparer(initctx) {
2995
2992
}
2996
2993
2997
2994
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) }" ) {
2999
2996
super .addConstraint(param, bound, fromBelow)
3000
2997
}
3001
2998
0 commit comments