diff options
author | Paul Phillips <paulp@improving.org> | 2011-04-23 22:04:36 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2011-04-23 22:04:36 +0000 |
commit | 63c7c9d857568879bfda146dd31bfc4ee38cb9fb (patch) | |
tree | f11372dc3d38c1eb0a327b33afb9fb25a0a7a658 /test/files/run/bug2800.scala | |
parent | 21121ff62ea72523ed5ea6a906b2ce42e9e47f69 (diff) | |
download | scala-63c7c9d857568879bfda146dd31bfc4ee38cb9fb.tar.gz scala-63c7c9d857568879bfda146dd31bfc4ee38cb9fb.tar.bz2 scala-63c7c9d857568879bfda146dd31bfc4ee38cb9fb.zip |
Working my way through pattern matcher sequence...
Working my way through pattern matcher sequence issues mostly caused by
the special handling of Lists. Also deleting all kinds of useless or
almost useless code which is presently only clutter.
Closes #2756, #2800, #3050, #3530, #3972, no review.
Diffstat (limited to 'test/files/run/bug2800.scala')
-rw-r--r-- | test/files/run/bug2800.scala | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/test/files/run/bug2800.scala b/test/files/run/bug2800.scala new file mode 100644 index 0000000000..84d1de0507 --- /dev/null +++ b/test/files/run/bug2800.scala @@ -0,0 +1,36 @@ +object Test { + def f1 = ("": Any) match { case List(x @ _*) => x ; case _ => false } + def f2 = (5: Any) match { case List(x @ _*) => x ; case _ => false } + def f3 = (Nil: Any) match { case List(x @ _*) => x ; case _ => false } + def f4 = (Array(1): Any) match { case List(x @ _*) => x ; case _ => false } + + def f5 = ("": Any) match { case Array(x @ _*) => x ; case _ => false } + def f6 = (5: Any) match { case Array(x @ _*) => x ; case _ => false } + def f7 = (Nil: Any) match { case Array(x @ _*) => x ; case _ => false } + def f8 = (Array(1): Any) match { case Array(x @ _*) => x ; case _ => false } + + def f9 = ("": Any) match { case x @ List(_*) => x ; case _ => false } + def f10 = ("": Any) match { case List(_*) => true ; case _ => false } + def f11 = (Nil: Any) match { case List(_*) => true ; case _ => false } + def f12 = ("": Any) match { case x @ Array(_*) => x ; case _ => false } + def f13 = ("": Any) match { case Array(_*) => true ; case _ => false } + def f14 = (Nil: Any) match { case Array(_*) => true ; case _ => false } + + + def main(args: Array[String]): Unit = { + println(f1) + println(f2) + println(f3) + println(f4) + println(f5) + println(f6) + println(f7) + println(f8) + println(f9) + println(f10) + println(f11) + println(f12) + println(f13) + println(f14) + } +} |