summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2009-10-13 15:39:22 +0000
committerMartin Odersky <odersky@gmail.com>2009-10-13 15:39:22 +0000
commit820e0bd94001e2732b119d217a12844e4720d165 (patch)
tree0307e5751c9b3e2decb605ed7145429887df73d1 /test
parent04d037f2e1addcd36f0d990c4f1d37106317959e (diff)
downloadscala-820e0bd94001e2732b119d217a12844e4720d165.tar.gz
scala-820e0bd94001e2732b119d217a12844e4720d165.tar.bz2
scala-820e0bd94001e2732b119d217a12844e4720d165.zip
Fixed #2422 abd #2461
Diffstat (limited to 'test')
-rw-r--r--test/files/pos/arrays2.scala12
-rw-r--r--test/files/run/t493.scala22
-rw-r--r--test/pending/neg/t1477.scala25
3 files changed, 59 insertions, 0 deletions
diff --git a/test/files/pos/arrays2.scala b/test/files/pos/arrays2.scala
index 6f4a09a401..795c486e37 100644
--- a/test/files/pos/arrays2.scala
+++ b/test/files/pos/arrays2.scala
@@ -9,3 +9,15 @@ object arrays2 {
}
}
+// #2422
+object arrays4 {
+ val args = Array[String]("World")
+ "Hello %1$s".format(args: _*)
+}
+
+// #2461
+object arrays3 {
+ import scala.collection.JavaConversions._
+ def apply[X](xs : X*) : java.util.List[X] = java.util.Arrays.asList(xs: _*)
+}
+
diff --git a/test/files/run/t493.scala b/test/files/run/t493.scala
new file mode 100644
index 0000000000..7aaad1fece
--- /dev/null
+++ b/test/files/run/t493.scala
@@ -0,0 +1,22 @@
+object Test {
+
+ val y = new collection.mutable.HashMap[String,Any]
+ val z = new collection.mutable.HashMap[String,Any]
+
+ y("msg") = Array[String]("1","2")
+
+ val array: Array[String] = Array[String]("1","2")
+ z("msg") = array
+
+ def main(args:Array[String]) = {
+
+ assert(y("msg").isInstanceOf[Array[_]])
+ assert(z("msg").isInstanceOf[Array[_]])
+
+ // these work, without producing a match error
+
+ (z.get("msg"): @unchecked) match {
+ case Some(_:Array[String]) =>
+ }
+ }
+}
diff --git a/test/pending/neg/t1477.scala b/test/pending/neg/t1477.scala
new file mode 100644
index 0000000000..0cc0cd5f7a
--- /dev/null
+++ b/test/pending/neg/t1477.scala
@@ -0,0 +1,25 @@
+object Test extends Application {
+ trait A
+ trait B extends A
+
+ trait C {
+ type U
+ trait D { type T >: B <: A }
+ type V <: D
+ val y: V#T = new B { }
+ }
+
+ trait Middle extends C {
+ type V <: (D with U)
+ }
+
+ class D extends Middle {
+ trait E
+ trait F { type T = E }
+ type U = F
+ def frob(arg : E) : E = arg
+ frob(y)
+ }
+
+ new D
+}