summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2008-07-28 10:00:31 +0000
committerMartin Odersky <odersky@gmail.com>2008-07-28 10:00:31 +0000
commitd492b489b176a3d2a4da0d199756af86514be352 (patch)
treee5cf7bedfa037a03f0fbf1bb72564114473edef0 /test
parentc8b3af98b9dd45a358332f60e3bc8f5b8b3c604a (diff)
downloadscala-d492b489b176a3d2a4da0d199756af86514be352.tar.gz
scala-d492b489b176a3d2a4da0d199756af86514be352.tar.bz2
scala-d492b489b176a3d2a4da0d199756af86514be352.zip
fixed #842, #945, #83, #996, #1016, + some perf...
fixed #842, #945, #83, #996, #1016, + some performace tuning.
Diffstat (limited to 'test')
-rw-r--r--test/files/neg/t0764.check2
-rw-r--r--test/files/neg/t0842.check4
-rwxr-xr-xtest/files/neg/t0842.scala1
-rwxr-xr-xtest/files/pos/t0872.scala8
-rw-r--r--test/pending/pos/t0756.scala8
-rw-r--r--test/pending/pos/t0774/unrelated.scala9
-rw-r--r--test/pending/pos/t0805.scala9
-rwxr-xr-xtest/pending/run/t0508x.scala21
-rw-r--r--test/pending/run/t0818.scala4
9 files changed, 65 insertions, 1 deletions
diff --git a/test/files/neg/t0764.check b/test/files/neg/t0764.check
index b622f17c5e..9f0cedc69b 100644
--- a/test/files/neg/t0764.check
+++ b/test/files/neg/t0764.check
@@ -1,5 +1,5 @@
t0764.scala:13: error: type mismatch;
- found : java.lang.Object with Node{type T = _1.type} where val _1: Main.this.AType
+ found : java.lang.Object with Node{type T = _1.type} where val _1: Node{type T = NextType}
required: Node{type T = Main.this.AType}
new Main[AType]( (value: AType).prepend )
^
diff --git a/test/files/neg/t0842.check b/test/files/neg/t0842.check
new file mode 100644
index 0000000000..5f88f08194
--- /dev/null
+++ b/test/files/neg/t0842.check
@@ -0,0 +1,4 @@
+t0842.scala:1: error: A.this.type does not take type parameters
+trait A[T] { def m: this.type[T] = this }
+ ^
+one error found
diff --git a/test/files/neg/t0842.scala b/test/files/neg/t0842.scala
new file mode 100755
index 0000000000..f32c2ba26d
--- /dev/null
+++ b/test/files/neg/t0842.scala
@@ -0,0 +1 @@
+trait A[T] { def m: this.type[T] = this }
diff --git a/test/files/pos/t0872.scala b/test/files/pos/t0872.scala
new file mode 100755
index 0000000000..8f4c1c4436
--- /dev/null
+++ b/test/files/pos/t0872.scala
@@ -0,0 +1,8 @@
+object Main {
+ def main(args : Array[String]) {
+ val fn = (a : Int, str : String) => "a: " + a + ", str: " + str
+ implicit def fx[T](f : (T,String) => String) = (x:T) => f(x,null)
+ println(fn(1))
+ ()
+ }
+}
diff --git a/test/pending/pos/t0756.scala b/test/pending/pos/t0756.scala
new file mode 100644
index 0000000000..a778bd63d0
--- /dev/null
+++ b/test/pending/pos/t0756.scala
@@ -0,0 +1,8 @@
+object Test {
+ for {
+ n <- Some(42)
+
+ _
+ m <- Some(24)
+ } yield n
+}
diff --git a/test/pending/pos/t0774/unrelated.scala b/test/pending/pos/t0774/unrelated.scala
new file mode 100644
index 0000000000..1efdb2505e
--- /dev/null
+++ b/test/pending/pos/t0774/unrelated.scala
@@ -0,0 +1,9 @@
+object Outer {
+ import Inner._
+
+ deathname
+
+ object Inner {
+ def deathname: Int = 1
+ }
+}
diff --git a/test/pending/pos/t0805.scala b/test/pending/pos/t0805.scala
new file mode 100644
index 0000000000..565a2a6527
--- /dev/null
+++ b/test/pending/pos/t0805.scala
@@ -0,0 +1,9 @@
+package fr.up5.mi.noel.scala
+object Test {
+ def make(t: Test) : Test = TestList(t.args.toList)
+}
+case class TestList[T](elements: List[T])(implicit f: T => Test)
+
+class Test {
+ val args: Array[Test]
+}
diff --git a/test/pending/run/t0508x.scala b/test/pending/run/t0508x.scala
new file mode 100755
index 0000000000..0c1ffde3ed
--- /dev/null
+++ b/test/pending/run/t0508x.scala
@@ -0,0 +1,21 @@
+ final object Test extends java.lang.Object with Application {
+
+ class Foo(val s: String, val n: Int) extends java.lang.Object {
+ };
+
+ def foo[A >: Nothing <: Any, B >: Nothing <: Any, C >: Nothing <: Any]
+ (unapply1: (A) => Option[(B, C)], v: A): Unit =
+ unapply1.apply(v) match {
+ case Some((fst @ _, snd @ _)) =>
+ scala.Predef.println(scala.Tuple2.apply[java.lang.String, java.lang.String]("first: ".+(fst), " second: ".+(snd)))
+ case _ => scala.Predef.println(":(")
+ }
+ Test.this.foo[Test.Foo, String, Int]({
+ ((eta$0$1: Test.Foo) => Test.this.Foo.unapply(eta$0$1))
+ }, Test.this.Foo.apply("this might be fun", 10));
+ final object Foo extends java.lang.Object with ((String, Int) => Test.Foo) {
+ def unapply(x$0: Test.Foo): Some[(String, Int)] = scala.Some.apply[(String, Int)](scala.Tuple2.apply[String, Int](x$0.s, x$0.n));
+ def apply(s: String, n: Int): Test.Foo = new Test.this.Foo(s, n)
+ }
+ }
+
diff --git a/test/pending/run/t0818.scala b/test/pending/run/t0818.scala
new file mode 100644
index 0000000000..677b85d920
--- /dev/null
+++ b/test/pending/run/t0818.scala
@@ -0,0 +1,4 @@
+object Seth extends Application {
+ println(
+ new java.util.ArrayList[String]().toArray(Array[String]()))
+}