aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2013-12-28 21:46:05 +0100
committerMartin Odersky <odersky@gmail.com>2013-12-28 21:46:05 +0100
commit3c8196300d65738d6779ba8703e2a86ee3390ec7 (patch)
treed8edb5ee7eff6c2e012c0fef9e73938d7f3eeacc /tests
parent53c0d8996c5d065bff2f860948e5c563b187d221 (diff)
downloaddotty-3c8196300d65738d6779ba8703e2a86ee3390ec7.tar.gz
dotty-3c8196300d65738d6779ba8703e2a86ee3390ec7.tar.bz2
dotty-3c8196300d65738d6779ba8703e2a86ee3390ec7.zip
New version of eta-expansion.
This version expands a method ref p.m to the untyped tree p.m(_, ..., _) (after lifting impure expressions from p). Afterwards the usual application mechanisms kick in. This fixes problems also present in Scala 2.x, where an eta-expanded function was not as flexible as an explicitly expanded one (for instance, eta expansion did not honor default parameters).
Diffstat (limited to 'tests')
-rw-r--r--tests/pos/typers.scala4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/pos/typers.scala b/tests/pos/typers.scala
index dbbee3d74..dd08bab07 100644
--- a/tests/pos/typers.scala
+++ b/tests/pos/typers.scala
@@ -3,6 +3,10 @@ package test
import annotation.{tailrec, switch}
object typers {
+
+ def fun(x: Int): Int = x + 1
+
+ val foo = fun(_)
class List[+T] {
def :: (x: T) = new :: (x, this)