summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2009-10-05 21:22:06 +0000
committerPaul Phillips <paulp@improving.org>2009-10-05 21:22:06 +0000
commitf52458dfff38f9b50031f796d09ce02d370b9bd3 (patch)
tree9f5edd965f1ef09cd36e82982d6920b98a32d9f7 /test
parent7804031bb3591a51d68a3a2bdeea69f2bacc3e5f (diff)
downloadscala-f52458dfff38f9b50031f796d09ce02d370b9bd3.tar.gz
scala-f52458dfff38f9b50031f796d09ce02d370b9bd3.tar.bz2
scala-f52458dfff38f9b50031f796d09ce02d370b9bd3.zip
Test cases for some tickets fixed by recent arr...
Test cases for some tickets fixed by recent array and implicit activity: #1038, #1005, #1272.
Diffstat (limited to 'test')
-rw-r--r--test/files/neg/bug1038.check5
-rw-r--r--test/files/neg/bug1038.scala8
-rw-r--r--test/files/pos/bug1272.scala9
-rw-r--r--test/files/run/bug1005.check2
-rw-r--r--test/files/run/bug1005.scala19
5 files changed, 43 insertions, 0 deletions
diff --git a/test/files/neg/bug1038.check b/test/files/neg/bug1038.check
new file mode 100644
index 0000000000..e09cbbc510
--- /dev/null
+++ b/test/files/neg/bug1038.check
@@ -0,0 +1,5 @@
+bug1038.scala:4: error: not enough arguments for constructor X: (x: Int)X.
+Unspecified value parameter x.
+ val a = new X
+ ^
+one error found
diff --git a/test/files/neg/bug1038.scala b/test/files/neg/bug1038.scala
new file mode 100644
index 0000000000..9fdcae207f
--- /dev/null
+++ b/test/files/neg/bug1038.scala
@@ -0,0 +1,8 @@
+class X(x : Int)
+
+object Y {
+ val a = new X
+ import a._
+ implicit val b : Int = 1
+ implicit val c = 2
+} \ No newline at end of file
diff --git a/test/files/pos/bug1272.scala b/test/files/pos/bug1272.scala
new file mode 100644
index 0000000000..d86a909ae5
--- /dev/null
+++ b/test/files/pos/bug1272.scala
@@ -0,0 +1,9 @@
+object ImplicitTest {
+ implicit val i : Int = 10
+ implicit def a(implicit i : Int) : Array[Byte] = null
+ implicit def b[T](implicit i : Int) : Array[T] = null
+
+ def fn[T](implicit x : T) = 0
+
+ val x = fn[Array[Byte]]
+} \ No newline at end of file
diff --git a/test/files/run/bug1005.check b/test/files/run/bug1005.check
new file mode 100644
index 0000000000..6ec0929090
--- /dev/null
+++ b/test/files/run/bug1005.check
@@ -0,0 +1,2 @@
+Halp!
+Halp!
diff --git a/test/files/run/bug1005.scala b/test/files/run/bug1005.scala
new file mode 100644
index 0000000000..5ccd89dd85
--- /dev/null
+++ b/test/files/run/bug1005.scala
@@ -0,0 +1,19 @@
+object Test
+{
+ class Foo[T](x : Array[AnyRef]) { def bar = x.asInstanceOf[Array[T]] }
+ class Bar[T](x : Array[T]) { def bar = x.asInstanceOf[Array[AnyRef]] }
+
+ object FromMono{
+ def main(args : Array[String]) = (new Foo[AnyRef](Array[AnyRef]("Halp!"))).bar
+ }
+
+ object FromPoly{
+ def main(args : Array[String]) = (new Bar[AnyRef](Array[AnyRef]("Halp!"))).bar
+ }
+
+ def main(args: Array[String]): Unit = {
+ println(FromMono main null mkString)
+ println(FromPoly main null mkString)
+ }
+}
+