diff options
author | odersky <odersky@gmail.com> | 2016-04-26 13:35:30 +0200 |
---|---|---|
committer | odersky <odersky@gmail.com> | 2016-04-26 13:35:30 +0200 |
commit | 6b0ae0b16d7799da478771ff9368ea241013f43b (patch) | |
tree | d39a8f31cfd039e2c435308bc89f98dfc023cf05 /tests/neg | |
parent | d5dfd16083728d6d4afdf58a224a4bd2829969b1 (diff) | |
parent | 02f1ec90f02d347da8d9cafff8782906699cac66 (diff) | |
download | dotty-6b0ae0b16d7799da478771ff9368ea241013f43b.tar.gz dotty-6b0ae0b16d7799da478771ff9368ea241013f43b.tar.bz2 dotty-6b0ae0b16d7799da478771ff9368ea241013f43b.zip |
Merge branch 'master' into fix-equality
Diffstat (limited to 'tests/neg')
-rw-r--r-- | tests/neg/tailcall/i1221.scala | 10 | ||||
-rw-r--r-- | tests/neg/tailcall/i1221b.scala | 10 |
2 files changed, 20 insertions, 0 deletions
diff --git a/tests/neg/tailcall/i1221.scala b/tests/neg/tailcall/i1221.scala new file mode 100644 index 000000000..7cf9312f5 --- /dev/null +++ b/tests/neg/tailcall/i1221.scala @@ -0,0 +1,10 @@ +import annotation.tailrec + +object I1221{ + final def foo(a: Int): Int = { + if ((foo(a - 1): @tailrec) > 0) // error: not in tail position + foo(a - 1): @tailrec + else + foo(a - 2): @tailrec + } +} diff --git a/tests/neg/tailcall/i1221b.scala b/tests/neg/tailcall/i1221b.scala new file mode 100644 index 000000000..f8e2add9a --- /dev/null +++ b/tests/neg/tailcall/i1221b.scala @@ -0,0 +1,10 @@ +import annotation.tailrec + +class Test { + def foo(a: Int): Int = { // error: method is not final + if ((foo(a - 1): @tailrec) > 0) + foo(a - 1): @tailrec + else + foo(a - 2): @tailrec + } +} |