diff options
author | Martin Odersky <odersky@gmail.com> | 2010-03-16 16:12:46 +0000 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2010-03-16 16:12:46 +0000 |
commit | 70de5c3890657248e5e7f929dc877a84ba63710e (patch) | |
tree | e0dcd25ab6869bff0104c35c5f32115e58e06b21 /test/files/neg | |
parent | 2515edd33b3799ea641dba7036b35a0628d03b4b (diff) | |
download | scala-70de5c3890657248e5e7f929dc877a84ba63710e.tar.gz scala-70de5c3890657248e5e7f929dc877a84ba63710e.tar.bz2 scala-70de5c3890657248e5e7f929dc877a84ba63710e.zip |
new tests
Diffstat (limited to 'test/files/neg')
-rw-r--r-- | test/files/neg/t0851.check | 9 | ||||
-rw-r--r-- | test/files/neg/t0851.scala | 25 | ||||
-rw-r--r-- | test/files/neg/t2918.check | 7 | ||||
-rwxr-xr-x | test/files/neg/t2918.scala | 3 |
4 files changed, 10 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 +} |