summaryrefslogtreecommitdiff
path: root/test/files/pos/sammy_poly.scala
blob: ba10baea492554f19351797d5d8eb3fb3eefc6f8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
// test synthesizeSAMFunction where the sam type is not fully defined
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))
}