aboutsummaryrefslogtreecommitdiff
path: root/tests/neg/tailcall
diff options
context:
space:
mode:
authorDmitry Petrashko <dmitry.petrashko@gmail.com>2016-03-31 14:27:30 +0200
committerDmitry Petrashko <dmitry.petrashko@gmail.com>2016-03-31 14:50:36 +0200
commitaab561c46144f2d9510ba881bf8dc0549631292a (patch)
tree9d4516e4c6c0062d021a5853d5d060bfb97e38e4 /tests/neg/tailcall
parent07833e93f62cbe6d866300475288e8a763a36198 (diff)
downloaddotty-aab561c46144f2d9510ba881bf8dc0549631292a.tar.gz
dotty-aab561c46144f2d9510ba881bf8dc0549631292a.tar.bz2
dotty-aab561c46144f2d9510ba881bf8dc0549631292a.zip
Tailrec: drop support for polymorphic recursion.
If the method that recurses over a different type arguments, if this method is specialised, it would lead to method not being tail-rec anymore. Eg: def foo[@specialized A, @specialized B]: Unit = foo[B, A]
Diffstat (limited to 'tests/neg/tailcall')
-rw-r--r--tests/neg/tailcall/t6574.scala4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/neg/tailcall/t6574.scala b/tests/neg/tailcall/t6574.scala
index 7030b3b4a..d9ba2882d 100644
--- a/tests/neg/tailcall/t6574.scala
+++ b/tests/neg/tailcall/t6574.scala
@@ -4,7 +4,7 @@ class Bad[X, Y](val v: Int) extends AnyVal {
println("tail")
}
- @annotation.tailrec final def differentTypeArgs : Unit = {
- {(); new Bad[String, Unit](0)}.differentTypeArgs
+ @annotation.tailrec final def differentTypeArgs : Unit = { // error
+ {(); new Bad[String, Unit](0)}.differentTypeArgs // error
}
}