summaryrefslogtreecommitdiff
path: root/test/files/run/pure-args-byname-noinline.check
Commit message (Collapse)AuthorAgeFilesLines
* SI-6306 Remove incorrect eta-expansion optimization in UncurryPaolo Giarrusso2012-09-121-0/+12
Fix SI-6306 by removing the offending code. Moreover, clarify comment and add testcase. This pattern match only matches on testcases triggering SI-6306; the transformation it performs in that case is unsafe. The intended optimization is to undo eta-expansion of nullary functions, that is, transform `() => foo()` to `foo`. But that's only valid when `foo` is an instance of `Function0`, so the optimization is unsafe. Moreover, the pattern match will fail because at the end of typer that code has become `() => foo.apply()`, and `isExprSafeToInline(foo.apply)` always (correctly) fails the isExprSafeToInline test. The pattern match should thus be different - this code was dead even when it was introduced (45bcd02f6ba099277bedbf83ec2bda07435c7797), since it was not invoked either when building the compiler or when compiling function attempt2() in the included testcase. Thanks to all commenters on SI-6306 and https://github.com/scala/scala/pull/1255, in particular to Jason Zaugg for diagnosing the underlying fault and Lukas Rytz for understanding the goal of the code.