aboutsummaryrefslogtreecommitdiff
path: root/tests/pending/pos
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2014-10-07 14:23:38 +0200
committerDmitry Petrashko <dmitry.petrashko@gmail.com>2014-10-12 10:50:57 +0200
commitfd81127c6255d01237dd98e8296abf6fdfe80741 (patch)
treec9c6f2f6f17173fb5539c57022f68274e495a281 /tests/pending/pos
parentfa44d5cd694d76e285ebadcdf297f0d13936a6e9 (diff)
downloaddotty-fd81127c6255d01237dd98e8296abf6fdfe80741.tar.gz
dotty-fd81127c6255d01237dd98e8296abf6fdfe80741.tar.bz2
dotty-fd81127c6255d01237dd98e8296abf6fdfe80741.zip
New tests
Diffstat (limited to 'tests/pending/pos')
-rw-r--r--tests/pending/pos/annot.scala5
-rw-r--r--tests/pending/pos/t1672.scala36
-rw-r--r--tests/pending/pos/vararg-pattern.scala12
3 files changed, 53 insertions, 0 deletions
diff --git a/tests/pending/pos/annot.scala b/tests/pending/pos/annot.scala
new file mode 100644
index 000000000..8e21803b4
--- /dev/null
+++ b/tests/pending/pos/annot.scala
@@ -0,0 +1,5 @@
+class Test {
+
+ @SuppressWarnings("hi") def foo() = ???
+
+}
diff --git a/tests/pending/pos/t1672.scala b/tests/pending/pos/t1672.scala
new file mode 100644
index 000000000..77a86db22
--- /dev/null
+++ b/tests/pending/pos/t1672.scala
@@ -0,0 +1,36 @@
+// moved to pending.
+/* Tail calls translates this program to:
+
+final lazy object Test1672: Test1672$ = new Test1672$()
+ final class Test1672$() extends Object() { this: Test1672$.type =>
+ @tailrec def bar: (x: Int)(y: Int)Nothing = {
+ def tailLabel2: ($this: Test1672$.type)(x: Int)(y: Int)Nothing = {
+ try {
+ throw new scala.package.RuntimeException()
+ } catch {
+ def $anonfun: (x$1: Throwable)Nothing =
+ x$1 match {
+ case _: scala.package.Throwable =>
+ tailLabel2($this)(x)(y)
+ }
+ closure($anonfun)
+ }
+ }
+ tailLabel2(Test1672$.this)(x)(y)
+ }
+ }
+
+Note the tail call to taillabel2 from the local method $anonfun.
+LambdaLift doe snot know how to deal wioth this.
+*/
+
+object Test1672 {
+ @annotation.tailrec
+ def bar(x: Int)(y: Int) : Nothing = {
+ try {
+ throw new RuntimeException
+ } catch {
+ case _: Throwable => bar(x)(y)
+ }
+ }
+}
diff --git a/tests/pending/pos/vararg-pattern.scala b/tests/pending/pos/vararg-pattern.scala
new file mode 100644
index 000000000..314d6460f
--- /dev/null
+++ b/tests/pending/pos/vararg-pattern.scala
@@ -0,0 +1,12 @@
+object Test {
+
+ List(1, 2, 3, 4) match {
+ case List(1, 2, xs: _*) =>
+ val ys: Seq[Int] = xs
+ println(ys)
+ }
+ val List(1, 2, x: _*) = List(1, 2, 3, 4)
+
+}
+
+