From 70de5c3890657248e5e7f929dc877a84ba63710e Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Tue, 16 Mar 2010 16:12:46 +0000 Subject: new tests --- test/files/pos/t2913.scala | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'test/files/pos/t2913.scala') 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)) + () + } +} -- cgit v1.2.3