summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2010-03-16 16:12:46 +0000
committerMartin Odersky <odersky@gmail.com>2010-03-16 16:12:46 +0000
commit70de5c3890657248e5e7f929dc877a84ba63710e (patch)
treee0dcd25ab6869bff0104c35c5f32115e58e06b21 /test
parent2515edd33b3799ea641dba7036b35a0628d03b4b (diff)
downloadscala-70de5c3890657248e5e7f929dc877a84ba63710e.tar.gz
scala-70de5c3890657248e5e7f929dc877a84ba63710e.tar.bz2
scala-70de5c3890657248e5e7f929dc877a84ba63710e.zip
new tests
Diffstat (limited to 'test')
-rw-r--r--test/files/neg/t0851.check9
-rw-r--r--test/files/neg/t0851.scala25
-rw-r--r--test/files/neg/t2918.check7
-rwxr-xr-xtest/files/neg/t2918.scala3
-rwxr-xr-xtest/files/pos/t2913.scala22
5 files changed, 32 insertions, 34 deletions
diff --git a/test/files/neg/t0851.check b/test/files/neg/t0851.check
deleted file mode 100644
index 61d2a98632..0000000000
--- a/test/files/neg/t0851.check
+++ /dev/null
@@ -1,9 +0,0 @@
-t0851.scala:14: error: not enough arguments for method apply: (v1: Int,v2: String)java.lang.String in trait Function2.
-Unspecified value parameter v2.
- println(f(1))
- ^
-t0851.scala:22: error: not enough arguments for method apply: (v1: Int,v2: String)java.lang.String in trait Function2.
-Unspecified value parameter v2.
- println(fn(1))
- ^
-two errors found
diff --git a/test/files/neg/t0851.scala b/test/files/neg/t0851.scala
deleted file mode 100644
index b28be2c697..0000000000
--- a/test/files/neg/t0851.scala
+++ /dev/null
@@ -1,25 +0,0 @@
-package test
-
-// This gives now type errors about missing parameters, which seems OK to me.
-// The tests just make sure it does not crash
-
-object test1 {
- case class Foo[T,T2](f : (T,T2) => String) extends (((T,T2)) => String){
- def apply(t : T) = (s:T2) => f(t,s)
- def apply(p : (T,T2)) = f(p._1,p._2)
- }
- implicit def g[T](f : (T,String) => String) = Foo(f)
- def main(args : Array[String]) : Unit = {
- val f = (x:Int,s:String) => s + x
- println(f(1))
- ()
- }
-}
-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/files/neg/t2918.check b/test/files/neg/t2918.check
new file mode 100644
index 0000000000..e67f24ec57
--- /dev/null
+++ b/test/files/neg/t2918.check
@@ -0,0 +1,7 @@
+t2918.scala:2: error: cyclic aliasing or subtyping involving type A
+ def g[X, A[X] <: A[X]](x: A[X]) = x
+ ^
+t2918.scala:2: error: A does not take type parameters
+ def g[X, A[X] <: A[X]](x: A[X]) = x
+ ^
+two errors found
diff --git a/test/files/neg/t2918.scala b/test/files/neg/t2918.scala
new file mode 100755
index 0000000000..ff2be39ae0
--- /dev/null
+++ b/test/files/neg/t2918.scala
@@ -0,0 +1,3 @@
+object Test {
+ def g[X, A[X] <: A[X]](x: A[X]) = x
+}
diff --git a/test/files/pos/t2913.scala b/test/files/pos/t2913.scala
index 4b8d89274b..11d8b92053 100755
--- a/test/files/pos/t2913.scala
+++ b/test/files/pos/t2913.scala
@@ -29,3 +29,25 @@ object Test {
// Typers#tryTypedApply:3274 only checks if the error is as the same position as `foo`, `"a"`, or `"b"`.
// None of these po
}
+
+// t0851 is essentially the same:
+object test1 {
+ case class Foo[T,T2](f : (T,T2) => String) extends (((T,T2)) => String){
+ def apply(t : T) = (s:T2) => f(t,s)
+ def apply(p : (T,T2)) = f(p._1,p._2)
+ }
+ implicit def g[T](f : (T,String) => String) = Foo(f)
+ def main(args : Array[String]) : Unit = {
+ val f = (x:Int,s:String) => s + x
+ println(f(1))
+ ()
+ }
+}
+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))
+ ()
+ }
+}