@@ -438,8 +438,8 @@ class TailRec extends MiniPhase {
438438 if (tree.symbol.is(Synthetic ))
439439 noTailTransform(tree.rhs)
440440 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
443443 // want to call noTailTransform
444444 // We can however warn in this case, as its likely in this situation that someone would expect a tail
445445 // 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 {
459459
460460 case Return (expr, from) =>
461461 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
464464 cpy.Return (tree)(transform(expr, inTailPosition), from)
465465
466466 case _ =>
0 commit comments