diff options
Diffstat (limited to 'test/files/pos/sammy_poly.scala')
-rw-r--r-- | test/files/pos/sammy_poly.scala | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/test/files/pos/sammy_poly.scala b/test/files/pos/sammy_poly.scala index c629be7166..ba10baea49 100644 --- a/test/files/pos/sammy_poly.scala +++ b/test/files/pos/sammy_poly.scala @@ -1,7 +1,12 @@ // test synthesizeSAMFunction where the sam type is not fully defined -class T { - trait F[T, U] { def apply(x: 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)) -}
\ No newline at end of file +} |