diff options
author | Guillaume Martres <smarter@ubuntu.com> | 2017-02-13 18:05:49 +0100 |
---|---|---|
committer | Guillaume Martres <smarter@ubuntu.com> | 2017-02-18 23:35:34 +0100 |
commit | 14e1c86113ca8af94b596cf6494213486d79dd12 (patch) | |
tree | 1cbae74cabdad8740691ea7e34ca143cc1b6ab3d /compiler | |
parent | 781988752d3cd8997241a692e41dc0d648533cee (diff) | |
download | dotty-14e1c86113ca8af94b596cf6494213486d79dd12.tar.gz dotty-14e1c86113ca8af94b596cf6494213486d79dd12.tar.bz2 dotty-14e1c86113ca8af94b596cf6494213486d79dd12.zip |
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.
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/src/dotty/tools/dotc/transform/TailRec.scala | 2 |
1 files changed, 1 insertions, 1 deletions
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 } |