@@ -438,8 +438,8 @@ class TailRec extends MiniPhase {
438
438
if (tree.symbol.is(Synthetic ))
439
439
noTailTransform(tree.rhs)
440
440
else
441
- // We cant tail recurse through nested definitions, so dont want to propagate to child nodes
442
- // We dont want to fail if there is a call that would recurse (as this would be a non self recurse), so dont
441
+ // We can't tail recurse through nested definitions, so don't want to propagate to child nodes
442
+ // We don't want to fail if there is a call that would recurse (as this would be a non self recurse), so don't
443
443
// want to call noTailTransform
444
444
// We can however warn in this case, as its likely in this situation that someone would expect a tail
445
445
// recursion optimization and enabling this to optimise would be a simple case of inlining the inner method
@@ -459,8 +459,8 @@ class TailRec extends MiniPhase {
459
459
460
460
case Return (expr, from) =>
461
461
val fromSym = from.symbol
462
- val inTailPosition = ( ! fromSym.is( Label ) || tailPositionLabeledSyms.contains(fromSym) ) // Label returns are only tail if the label is in tail position
463
- && ( ! fromSym.is( Method ) || (fromSym eq method) ) // Method returns are only tail if we are looking at the original method
462
+ val inTailPosition = tailPositionLabeledSyms.contains(fromSym) // Label returns are only tail if the label is in tail position
463
+ || (fromSym eq method) // Method returns are only tail if we are looking at the original method
464
464
cpy.Return (tree)(transform(expr, inTailPosition), from)
465
465
466
466
case _ =>
0 commit comments