diff options
author | Adriaan Moors <adriaan.moors@typesafe.com> | 2013-07-10 13:01:52 -0700 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@typesafe.com> | 2013-07-10 13:01:52 -0700 |
commit | 59947119eec1cb49c46f9ddf930741d1fb554f61 (patch) | |
tree | 1254f12da27de3047a929c70ecf08c61e7ffc555 /test/files/neg | |
parent | f4ec2816ba65398529a107b30e18328673204926 (diff) | |
parent | a90d1f01d603d9f00445ead48a87a051cd0ede15 (diff) | |
download | scala-59947119eec1cb49c46f9ddf930741d1fb554f61.tar.gz scala-59947119eec1cb49c46f9ddf930741d1fb554f61.tar.bz2 scala-59947119eec1cb49c46f9ddf930741d1fb554f61.zip |
Merge pull request #2717 from retronym/ticket/6574
SI-6574 Support @tailrec for extension methods.
Diffstat (limited to 'test/files/neg')
-rw-r--r-- | test/files/neg/t6574.check | 7 | ||||
-rw-r--r-- | test/files/neg/t6574.scala | 10 |
2 files changed, 17 insertions, 0 deletions
diff --git a/test/files/neg/t6574.check b/test/files/neg/t6574.check new file mode 100644 index 0000000000..c67b4ed804 --- /dev/null +++ b/test/files/neg/t6574.check @@ -0,0 +1,7 @@ +t6574.scala:4: error: could not optimize @tailrec annotated method notTailPos$extension: it contains a recursive call not in tail position + println("tail") + ^ +t6574.scala:8: error: could not optimize @tailrec annotated method differentTypeArgs$extension: it is called recursively with different type arguments + {(); new Bad[String, Unit](0)}.differentTypeArgs + ^ +two errors found diff --git a/test/files/neg/t6574.scala b/test/files/neg/t6574.scala new file mode 100644 index 0000000000..bba97ad62e --- /dev/null +++ b/test/files/neg/t6574.scala @@ -0,0 +1,10 @@ +class Bad[X, Y](val v: Int) extends AnyVal { + @annotation.tailrec final def notTailPos[Z](a: Int)(b: String) { + this.notTailPos[Z](a)(b) + println("tail") + } + + @annotation.tailrec final def differentTypeArgs { + {(); new Bad[String, Unit](0)}.differentTypeArgs + } +} |