summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/transform/UnCurry.scala
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2014-06-14 11:22:29 +0200
committerJason Zaugg <jzaugg@gmail.com>2015-04-21 16:51:01 +1000
commitd12d59a178c4056fb8ea3cdf4eab5ef453c9a113 (patch)
treee1c15f8f484db26b48d1c4ae3bed4277804a450d /src/compiler/scala/tools/nsc/transform/UnCurry.scala
parente1895d64f87dc3c699a3ccbc8a3143b18d3b5bb1 (diff)
downloadscala-d12d59a178c4056fb8ea3cdf4eab5ef453c9a113.tar.gz
scala-d12d59a178c4056fb8ea3cdf4eab5ef453c9a113.tar.bz2
scala-d12d59a178c4056fb8ea3cdf4eab5ef453c9a113.zip
Support specialized method-handle based lambdas
``` scala> (x: Int) => {??? : Int} res2: Int => Int = $$Lambda$1371/1961176822@6ed3ccb2 scala> res2(42) scala.NotImplementedError: an implementation is missing at scala.Predef$.$qmark$qmark$qmark(Predef.scala:225) at .$anonfun$1(<console>:8) at $$Lambda$1371/1961176822.apply$mcII$sp(Unknown Source) ... 33 elided scala> (x: Int, y: Long) => {??? : Int} res4: (Int, Long) => Int = $$Lambda$1382/1796047085@6f8e8894 scala> res4(0, 0L) scala.NotImplementedError: an implementation is missing at scala.Predef$.$qmark$qmark$qmark(Predef.scala:225) at .$anonfun$1(<console>:8) at $$Lambda$1382/1796047085.apply$mcIIJ$sp(Unknown Source) ... 33 elided ```
Diffstat (limited to 'src/compiler/scala/tools/nsc/transform/UnCurry.scala')
-rw-r--r--src/compiler/scala/tools/nsc/transform/UnCurry.scala2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/transform/UnCurry.scala b/src/compiler/scala/tools/nsc/transform/UnCurry.scala
index 6484d96a52..836ea808ac 100644
--- a/src/compiler/scala/tools/nsc/transform/UnCurry.scala
+++ b/src/compiler/scala/tools/nsc/transform/UnCurry.scala
@@ -237,7 +237,7 @@ abstract class UnCurry extends InfoTransform
def canUseDelamdafyMethod = (
(inConstructorFlag == 0) // Avoiding synthesizing code prone to SI-6666, SI-8363 by using old-style lambda translation
- && !isSpecialized // DelambdafyTransformer currently only emits generic FunctionN-s, use the old style in the meantime
+ && (!isSpecialized || (settings.target.value == "jvm-1.8")) // DelambdafyTransformer currently only emits generic FunctionN-s, use the old style in the meantime
)
if (inlineFunctionExpansion || !canUseDelamdafyMethod) {
val parents = addSerializable(abstractFunctionForFunctionType(fun.tpe))