summaryrefslogtreecommitdiff
path: root/test/files/run/delambdafy_uncurry_byname_method.scala
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2014-06-02 13:20:58 +0200
committerJason Zaugg <jzaugg@gmail.com>2015-04-10 12:04:34 +1000
commitea61b3f66007b1a0029a5f22a7de334924390f7c (patch)
tree5a204a737f83d56e05b94c10bdb15d32b661060a /test/files/run/delambdafy_uncurry_byname_method.scala
parentd14e065eb792a1eb77289f4a1320071c57c5d09b (diff)
downloadscala-ea61b3f66007b1a0029a5f22a7de334924390f7c.tar.gz
scala-ea61b3f66007b1a0029a5f22a7de334924390f7c.tar.bz2
scala-ea61b3f66007b1a0029a5f22a7de334924390f7c.zip
Disable -Ydelambdafy:method for specialized FunctionN
The Delambdafy phase generates its `FunctionN` subclasses after the specialization phase. As such, `((x: Int) => x).apply(42)` incurs boxing. This commit falls back to the `-Ydelambdafy:inline` in this case. This is done by running the specialization type map over the type of the function, and seeing if anything changes. To make this work robustly, we first need to ensure that the specialization info transformer has processed all the function types. This is not a fundamental limitation; we could in principle generate the specialized code. A followup change will use `-Ydelambdafy:method` as the basis for invokedymnamic lambdas. As part of that stream of work, we will synthesize specialization-aware lambdas, and remove the fallback to `-Ydelambdafy:inline`. I have updated some tests that intend to test the delambdafy transform to avoid use of specialized function types.
Diffstat (limited to 'test/files/run/delambdafy_uncurry_byname_method.scala')
-rw-r--r--test/files/run/delambdafy_uncurry_byname_method.scala4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/files/run/delambdafy_uncurry_byname_method.scala b/test/files/run/delambdafy_uncurry_byname_method.scala
index 1adeec8433..0ccc1f2e92 100644
--- a/test/files/run/delambdafy_uncurry_byname_method.scala
+++ b/test/files/run/delambdafy_uncurry_byname_method.scala
@@ -6,9 +6,9 @@ object Test extends DirectTest {
override def extraSettings: String = "-usejavacp -Xprint:uncurry -Ydelambdafy:method -Ystop-after:uncurry -d " + testOutput.path
override def code = """class Foo {
- | def bar(x: => Int) = x
+ | def bar(x: => String) = x
|
- | def foo = bar(1)
+ | def foo = bar("")
|}
|""".stripMargin.trim