@@ -195,7 +195,7 @@ class TypeComparer(initctx: Context) extends ConstraintHandling[AbsentContext] w
195
195
// }
196
196
assert(! ctx.settings.YnoDeepSubtypes .value)
197
197
if (Config .traceDeepSubTypeRecursions && ! this .isInstanceOf [ExplainingTypeComparer ])
198
- ctx.log(TypeComparer .explained(implicit ctx => ctx .typeComparer.isSubType(tp1, tp2, approx)))
198
+ ctx.log(TypeComparer .explained(the[ Context ] .typeComparer.isSubType(tp1, tp2, approx)))
199
199
}
200
200
// Eliminate LazyRefs before checking whether we have seen a type before
201
201
val normalize = new TypeMap {
@@ -2307,15 +2307,15 @@ object TypeComparer {
2307
2307
*/
2308
2308
val FreshApprox : ApproxState = new ApproxState (4 )
2309
2309
2310
- /** Show trace of comparison operations when performing `op` as result string */
2311
- def explaining [T ](say : String => Unit )(op : Context => T )(implicit ctx : Context ): T = {
2310
+ /** Show trace of comparison operations when performing `op` */
2311
+ def explaining [T ](say : String => Unit )(op : given Context => T )(implicit ctx : Context ): T = {
2312
2312
val nestedCtx = ctx.fresh.setTypeComparerFn(new ExplainingTypeComparer (_))
2313
- val res = try { op( nestedCtx) } finally { say(nestedCtx.typeComparer.lastTrace()) }
2313
+ val res = try { op given nestedCtx } finally { say(nestedCtx.typeComparer.lastTrace()) }
2314
2314
res
2315
2315
}
2316
2316
2317
2317
/** Like [[explaining ]], but returns the trace instead */
2318
- def explained [T ](op : Context => T )(implicit ctx : Context ): String = {
2318
+ def explained [T ](op : given Context => T )(implicit ctx : Context ): String = {
2319
2319
var trace : String = null
2320
2320
try { explaining(trace = _)(op) } catch { case ex : Throwable => ex.printStackTrace }
2321
2321
trace
0 commit comments