aboutsummaryrefslogtreecommitdiff
path: root/tests/pos/t0438.scala
Commit message (Collapse)AuthorAgeFilesLines
* Fix of t0438 - lambdas and eta expansionMartin Odersky2014-03-211-0/+12
Two fixes were needed 1) When typing a function value (x1: T1, ..., xN: Tn) => e, don't unconditionally issue an error if the expected function type arity is different from N. Instead, issue an error only if one of the types T1, ..., Tn is absent. The idea is that only then we need to consult the expected type for the parameter type. This allows to fix the problem later by an implicit conversion applied to the function value. 2) When eta-expanding, do not automtically take the arity of the expected function value as the arity of the generated lambda. Instead, take the method's arity, and copy method parameters into the lambda in case the arities are different.