diff options
author | Adriaan Moors <adriaan.moors@typesafe.com> | 2016-02-04 15:26:57 -0800 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@typesafe.com> | 2016-03-26 09:32:44 -0700 |
commit | 0d89ab1fe4adfe7165a2e3812d76dbb586c79798 (patch) | |
tree | 5db2839738954b9d020676b788cfd8979b5b487f /test/files | |
parent | 236d0e0db8b4c53837bd580e2b2022d86afde456 (diff) | |
download | scala-0d89ab1fe4adfe7165a2e3812d76dbb586c79798.tar.gz scala-0d89ab1fe4adfe7165a2e3812d76dbb586c79798.tar.bz2 scala-0d89ab1fe4adfe7165a2e3812d76dbb586c79798.zip |
SI-9449 sam expansion for explicitly eta-expanded method
Diffstat (limited to 'test/files')
-rw-r--r-- | test/files/pos/t9449.scala | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/test/files/pos/t9449.scala b/test/files/pos/t9449.scala new file mode 100644 index 0000000000..06653cca83 --- /dev/null +++ b/test/files/pos/t9449.scala @@ -0,0 +1,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 _ // fails -- should work + // typedTyped({ii : (() => <empty>)}) + // typedEta(ii, pt = II) + // adapt(ii, pt = (? => ?)) + // instantiatedToMethodType(ii, pt = (? => ?)) + // val ii3: II = ii _ // error: + // found : Int => Int + // required: II + } +}
\ No newline at end of file |