@@ -86,19 +86,21 @@ trait ConstraintHandling {
86
86
finally homogenizeArgs = saved
87
87
}
88
88
89
+ private def location (implicit ctx : Context ) = " " // i"in ${ctx.typerState.stateChainStr}" // use for debugging
90
+
89
91
protected def addUpperBound (param : TypeParamRef , bound : Type ): Boolean = {
90
92
def description = i " constraint $param <: $bound to \n $constraint"
91
93
if (bound.isRef(defn.NothingClass ) && ctx.typerState.isGlobalCommittable) {
92
94
def msg = s " !!! instantiated to Nothing: $param, constraint = ${constraint.show}"
93
95
if (Config .failOnInstantiationToNothing) assert(false , msg)
94
96
else ctx.log(msg)
95
97
}
96
- constr.println(i " adding $description in ${ctx.typerState.hashesStr} " )
98
+ constr.println(i " adding $description$location " )
97
99
val lower = constraint.lower(param)
98
100
val res =
99
101
addOneBound(param, bound, isUpper = true ) &&
100
102
lower.forall(addOneBound(_, bound, isUpper = true ))
101
- constr.println(i " added $description = $res in ${ctx.typerState.hashesStr} " )
103
+ constr.println(i " added $description = $res$location " )
102
104
res
103
105
}
104
106
@@ -109,7 +111,7 @@ trait ConstraintHandling {
109
111
val res =
110
112
addOneBound(param, bound, isUpper = false ) &&
111
113
upper.forall(addOneBound(_, bound, isUpper = false ))
112
- constr.println(i " added $description = $res in ${ctx.typerState.hashesStr} " )
114
+ constr.println(i " added $description = $res$location " )
113
115
res
114
116
}
115
117
@@ -122,12 +124,12 @@ trait ConstraintHandling {
122
124
val up2 = p2 :: constraint.exclusiveUpper(p2, p1)
123
125
val lo1 = constraint.nonParamBounds(p1).lo
124
126
val hi2 = constraint.nonParamBounds(p2).hi
125
- constr.println(i " adding $description down1 = $down1, up2 = $up2 ${ctx.typerState.hashesStr} " )
127
+ constr.println(i " adding $description down1 = $down1, up2 = $up2$location " )
126
128
constraint = constraint.addLess(p1, p2)
127
129
down1.forall(addOneBound(_, hi2, isUpper = true )) &&
128
130
up2.forall(addOneBound(_, lo1, isUpper = false ))
129
131
}
130
- constr.println(i " added $description = $res ${ctx.typerState.hashesStr} " )
132
+ constr.println(i " added $description = $res$location " )
131
133
res
132
134
}
133
135
0 commit comments