diff options
Diffstat (limited to 'test/files/pos/sammy_poly.scala')
-rw-r--r-- | test/files/pos/sammy_poly.scala | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/test/files/pos/sammy_poly.scala b/test/files/pos/sammy_poly.scala index 75ee36f654..ba10baea49 100644 --- a/test/files/pos/sammy_poly.scala +++ b/test/files/pos/sammy_poly.scala @@ -1,8 +1,12 @@ // test synthesizeSAMFunction where the sam type is not fully defined -class T { - trait F[T, U] { def apply(x: T): U } -// type F[T, U] = T => U - // NOTE: the f(x) desugaring for now assumes the single abstract method is called 'apply' +trait F[T, R]{ def apply(x: T): R } + +class PolySammy { + (x => x + 1): F[Int, Int] + ((x: Int) => x + 1): F[Int, Int] + ((x: String) => 1): F[String, Int] + ((x: Object) => 1): F[String, Int] + def app[T, U](x: T)(f: F[T, U]): U = f(x) app(1)(x => List(x)) } |