summaryrefslogtreecommitdiff
path: root/test/files/pos/t2913.scala
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/files/pos/t2913.scala
parent2515edd33b3799ea641dba7036b35a0628d03b4b (diff)
downloadscala-70de5c3890657248e5e7f929dc877a84ba63710e.tar.gz
scala-70de5c3890657248e5e7f929dc877a84ba63710e.tar.bz2
scala-70de5c3890657248e5e7f929dc877a84ba63710e.zip
new tests
Diffstat (limited to 'test/files/pos/t2913.scala')
-rwxr-xr-xtest/files/pos/t2913.scala22
1 files changed, 22 insertions, 0 deletions
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))
+ ()
+ }
+}