From 3c8196300d65738d6779ba8703e2a86ee3390ec7 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Sat, 28 Dec 2013 21:46:05 +0100 Subject: 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). --- tests/pos/typers.scala | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'tests') 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) -- cgit v1.2.3