diff options
Diffstat (limited to 'src/dotty/tools/dotc/transform/TailRec.scala')
-rw-r--r-- | src/dotty/tools/dotc/transform/TailRec.scala | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/dotty/tools/dotc/transform/TailRec.scala b/src/dotty/tools/dotc/transform/TailRec.scala index b3f63bcaf..46028e0fc 100644 --- a/src/dotty/tools/dotc/transform/TailRec.scala +++ b/src/dotty/tools/dotc/transform/TailRec.scala @@ -156,9 +156,8 @@ class TailRec extends MiniPhaseTransform with DenotTransformer with FullParamete def noTailTransform(tree: Tree)(implicit c: Context): Tree = transform(tree, noTailContext) - - def noTailTransforms(trees: List[Tree])(implicit c: Context) = - trees map (noTailTransform) + def noTailTransforms[Tr <: Tree](trees: List[Tr])(implicit c: Context): List[Tr] = + trees.map(noTailTransform).asInstanceOf[List[Tr]] override def transform(tree: Tree)(implicit c: Context): Tree = { /* A possibly polymorphic apply to be considered for tail call transformation. */ @@ -247,14 +246,14 @@ class TailRec extends MiniPhaseTransform with DenotTransformer with FullParamete // SI-1672 Catches are in tail position when there is no finalizer tpd.cpy.Try(tree)( noTailTransform(tree.expr), - transformHandlers(tree.handler), + transformSub(tree.cases), EmptyTree ) } else { tpd.cpy.Try(tree)( noTailTransform(tree.expr), - noTailTransform(tree.handler), + noTailTransforms(tree.cases), noTailTransform(tree.finalizer) ) } |