Skip to content

Commit 6d970ad

Browse files
committed
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.
1 parent 7f4d4fb commit 6d970ad

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compiler/src/dotty/tools/dotc/transform/TailRec.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ class TailRec extends MiniPhaseTransform with DenotTransformer with FullParamete
119119
// now this speculatively transforms tree and throws away result in many cases
120120
val rhsSemiTransformed = {
121121
val transformer = new TailRecElimination(origMeth, dd.tparams, owner, thisTpe, mandatory, label, abstractOverClass = defIsTopLevel)
122-
val rhs = atGroupEnd(transformer.transform(dd.rhs)(_))
122+
val rhs = atGroupEnd(implicit ctx => transformer.transform(dd.rhs))
123123
rewrote = transformer.rewrote
124124
rhs
125125
}

0 commit comments

Comments
 (0)