summaryrefslogtreecommitdiff
path: root/test/files/run/t5488-fn.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2012-02-18 22:55:34 -0800
committerPaul Phillips <paulp@improving.org>2012-02-18 23:48:26 -0800
commitec160bae7e2935d98bf71cfb6dcba61f1979b854 (patch)
tree11ed857d21aaac691481e12eabfc53a4446065d4 /test/files/run/t5488-fn.scala
parent0d19fe04eb43d39bdceab570fb5400a3a4b072ea (diff)
downloadscala-ec160bae7e2935d98bf71cfb6dcba61f1979b854.tar.gz
scala-ec160bae7e2935d98bf71cfb6dcba61f1979b854.tar.bz2
scala-ec160bae7e2935d98bf71cfb6dcba61f1979b854.zip
More on SI-5500.
A reimagining of erik's patch in 1df4fc6e59 . He did the hard part, this is the batman reboot. I added more tests and tried to make the anyref caching code less fragile.
Diffstat (limited to 'test/files/run/t5488-fn.scala')
-rw-r--r--test/files/run/t5488-fn.scala26
1 files changed, 2 insertions, 24 deletions
diff --git a/test/files/run/t5488-fn.scala b/test/files/run/t5488-fn.scala
index 9e4f60002b..d17bcf90a5 100644
--- a/test/files/run/t5488-fn.scala
+++ b/test/files/run/t5488-fn.scala
@@ -1,8 +1,5 @@
-class B[@specialized(Int, AnyRef, Unit) A, @specialized(Int, Unit) B](f: A => B)
-class C[@specialized(Int, AnyRef) A, @specialized(Int, AnyRef) B, @specialized(Int) C](f: (A, B) => C)
-// Not yet:
-// class B[@specialized(Int, AnyRef, Unit) A, @specialized(Int, AnyRef, Unit) B](f: A => B)
-// class C[@specialized(Int, AnyRef) A, @specialized(Int, AnyRef) B, @specialized(Int, AnyRef) C](f: (A, B) => C)
+class B[@specialized(Int, AnyRef, Unit) A, @specialized(Int, AnyRef, Unit) B](f: A => B)
+class C[@specialized(Int, AnyRef) A, @specialized(Int, AnyRef) B, @specialized(Int, AnyRef) C](f: (A, B) => C)
object Test {
def main(args:Array[String]) {
@@ -28,22 +25,3 @@ object Test {
show(new C((x: AnyRef, y: AnyRef) => "abc"))
}
}
-/** If the return types are specialized on AnyRef as well:
-
-files/run/t5488-fn.scala:18: error: type mismatch;
- found : Unit => String
- required: Unit => B$sp
- show(new B((x: Unit) => "abc"))
- ^
-files/run/t5488-fn.scala:24: error: type mismatch;
- found : (Int, Object) => String
- required: (Int, B$sp) => C$sp
- show(new C((x: Int, y: AnyRef) => "abc"))
- ^
-files/run/t5488-fn.scala:26: error: type mismatch;
- found : (Object, Int) => String
- required: (A$sp, Int) => C$sp
- show(new C((x: AnyRef, y: Int) => "abc"))
- ^
-three errors found
-**/