diff options
author | Paul Phillips <paulp@improving.org> | 2010-04-15 18:30:58 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2010-04-15 18:30:58 +0000 |
commit | 4fb3473182262b7cce33406ba7d0701e6622e3c3 (patch) | |
tree | ba2ce46bf92c86cf36095cb0c3b4da30c4d8a305 /src/compiler/scala/tools/nsc/transform/TailCalls.scala | |
parent | 348271c8b27af1c29f7705ea2853c934492ee327 (diff) | |
download | scala-4fb3473182262b7cce33406ba7d0701e6622e3c3.tar.gz scala-4fb3473182262b7cce33406ba7d0701e6622e3c3.tar.bz2 scala-4fb3473182262b7cce33406ba7d0701e6622e3c3.zip |
Removed a bunch of -Y warning options.
back in the form of a compiler plugin. Also promoted -Yfatal-warnings to
-Xfatal-warnings: this is key to writing tests which involve warnings
and should be at least semi-supported. Closes #3300, no review.
Diffstat (limited to 'src/compiler/scala/tools/nsc/transform/TailCalls.scala')
-rw-r--r-- | src/compiler/scala/tools/nsc/transform/TailCalls.scala | 16 |
1 files changed, 1 insertions, 15 deletions
diff --git a/src/compiler/scala/tools/nsc/transform/TailCalls.scala b/src/compiler/scala/tools/nsc/transform/TailCalls.scala index adeab550ee..effc75486d 100644 --- a/src/compiler/scala/tools/nsc/transform/TailCalls.scala +++ b/src/compiler/scala/tools/nsc/transform/TailCalls.scala @@ -163,15 +163,8 @@ abstract class TailCalls extends Transform newCtx.tailPos = true val isEligible = newCtx.currentMethod.isEffectivelyFinal || (newCtx.currentMethod.enclClass hasFlag Flags.MODULE) - // If -Ytailrecommend is given, we speculatively try transforming ineligible methods and - // report where we would have been successful. - val recommend = settings.Ytailrec.value - val savedFlags: Option[Long] = if (recommend) Some(newCtx.currentMethod.flags) else None - - if (isEligible || recommend) { - if (recommend) - newCtx.currentMethod.flags |= Flags.FINAL + if (isEligible) { newCtx.tparams = Nil log(" Considering " + name + " for tailcalls") tree.symbol.tpe match { @@ -185,7 +178,6 @@ abstract class TailCalls extends Transform val t1 = treeCopy.DefDef(tree, mods, name, tparams, vparams, tpt, { val transformed = transform(rhs, newCtx) - savedFlags foreach (newCtx.currentMethod.flags = _) transformed match { case newRHS if isEligible && newCtx.accessed => @@ -200,12 +192,6 @@ abstract class TailCalls extends Transform List(ValDef(newThis, This(currentClass))), LabelDef(newCtx.label, newThis :: (vparams.flatten map (_.symbol)), newRHS) ))) - case _ if recommend => - if (newCtx.accessed) - unit.warning(dd.pos, "method is tailrecommended") - // transform with the original flags restored - transform(rhs, newCtx) - case rhs => rhs } }) |