summaryrefslogtreecommitdiff
path: root/test/files/pos/t9449.scala
blob: 3b86dc80a0c0562b1b3be1caf9559d61f3d6891e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
trait II {
  def apply(x: Int): Int
}

object Test {
  def ii(x: Int): Int = x
  def test = {
    val ii1: II = x => ii(x) // works
    val ii2: II = ii         // works (adapting `ii` to `II`)
    val ii3: II = ii _       // works (failed before the fix)
                             // typedTyped({ii : (() => <empty>)})
                             //    typedEta(ii, pt = II)
                             //       adapt(ii, pt = (? => ?))
                             //          instantiatedToMethodType(ii, pt = (? => ?))
    // val ii3: II = ii _ // error:
    // found   : Int => Int
    // required: II
  }
}