diff options
author | Dmitry Petrashko <dmitry.petrashko@gmail.com> | 2014-04-04 12:14:43 +0200 |
---|---|---|
committer | Dmitry Petrashko <dmitry.petrashko@gmail.com> | 2014-04-11 14:51:20 +0200 |
commit | 6ebf6e2c3ef270f226a0fb42ebd59d24449942cf (patch) | |
tree | 66c35ac55cb4d4aad5c09d5a074894e682aabdd7 /tests/untried/neg/t1672b.check | |
parent | 4a3b96282584c77c85ae51f5d29cf7c6082cd7fb (diff) | |
download | dotty-6ebf6e2c3ef270f226a0fb42ebd59d24449942cf.tar.gz dotty-6ebf6e2c3ef270f226a0fb42ebd59d24449942cf.tar.bz2 dotty-6ebf6e2c3ef270f226a0fb42ebd59d24449942cf.zip |
TailRec phase and tests for it.
Ported tailcall phase from scalac with such changes:
- all transformation is done in the phase itself
(previously half of the work was done in backend)
- it is now able to run before uncurry
- it is now a treeTransform
- renamed to tailrec to make it more obvious that
this phase transforms only recursive calls.
For now this is a single phase which speculatively
transforms DefDefs.
Speculation can be potentially removed by
splitting into 2 phases:
one detecting which methods should be transformed
second performing transformation.
But, as transformation requires as same amount of work
as detection, I believe it will be simpler to maintain
it as a single phase.
Conflicts:
tests/pos/typers.scala
Diffstat (limited to 'tests/untried/neg/t1672b.check')
-rw-r--r-- | tests/untried/neg/t1672b.check | 16 |
1 files changed, 0 insertions, 16 deletions
diff --git a/tests/untried/neg/t1672b.check b/tests/untried/neg/t1672b.check deleted file mode 100644 index 60ccf7717..000000000 --- a/tests/untried/neg/t1672b.check +++ /dev/null @@ -1,16 +0,0 @@ -t1672b.scala:3: error: could not optimize @tailrec annotated method bar: it contains a recursive call not in tail position - def bar : Nothing = { - ^ -t1672b.scala:14: error: could not optimize @tailrec annotated method baz: it contains a recursive call not in tail position - def baz : Nothing = { - ^ -t1672b.scala:29: error: could not optimize @tailrec annotated method boz: it contains a recursive call not in tail position - case _: Throwable => boz; ??? - ^ -t1672b.scala:34: error: could not optimize @tailrec annotated method bez: it contains a recursive call not in tail position - def bez : Nothing = { - ^ -t1672b.scala:46: error: could not optimize @tailrec annotated method bar: it contains a recursive call not in tail position - else 1 + (try { - ^ -5 errors found |