@@ -195,7 +195,7 @@ class TypeComparer(initctx: Context) extends ConstraintHandling[AbsentContext] w
195195 // }
196196 assert(! ctx.settings.YnoDeepSubtypes .value)
197197 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)))
199199 }
200200 // Eliminate LazyRefs before checking whether we have seen a type before
201201 val normalize = new TypeMap {
@@ -2307,15 +2307,15 @@ object TypeComparer {
23072307 */
23082308 val FreshApprox : ApproxState = new ApproxState (4 )
23092309
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 = {
23122312 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()) }
23142314 res
23152315 }
23162316
23172317 /** 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 = {
23192319 var trace : String = null
23202320 try { explaining(trace = _)(op) } catch { case ex : Throwable => ex.printStackTrace }
23212321 trace
0 commit comments