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