From 14e1c86113ca8af94b596cf6494213486d79dd12 Mon Sep 17 00:00:00 2001 From: Guillaume Martres Date: Mon, 13 Feb 2017 18:05:49 +0100 Subject: TailRec: Avoid harmless capture of Context The captured context was passed implicitly to dd.rhs, atGroupEnd is always run with the same runId as the captured context so this should be okay, but it's better to avoid using two contexts in the same expression anyway. --- compiler/src/dotty/tools/dotc/transform/TailRec.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/src/dotty/tools/dotc/transform/TailRec.scala b/compiler/src/dotty/tools/dotc/transform/TailRec.scala index 3e7a7ed89..aa0845605 100644 --- a/compiler/src/dotty/tools/dotc/transform/TailRec.scala +++ b/compiler/src/dotty/tools/dotc/transform/TailRec.scala @@ -119,7 +119,7 @@ class TailRec extends MiniPhaseTransform with DenotTransformer with FullParamete // now this speculatively transforms tree and throws away result in many cases val rhsSemiTransformed = { val transformer = new TailRecElimination(origMeth, dd.tparams, owner, thisTpe, mandatory, label, abstractOverClass = defIsTopLevel) - val rhs = atGroupEnd(transformer.transform(dd.rhs)(_)) + val rhs = atGroupEnd(implicit ctx => transformer.transform(dd.rhs)) rewrote = transformer.rewrote rhs } -- cgit v1.2.3