summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/transform/Delambdafy.scala
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2014-02-10 08:59:22 +0100
committerJason Zaugg <jzaugg@gmail.com>2014-02-10 09:06:45 +0100
commitd6b1e6e4ff1cb477e9b26ba7e1a02d1ea98fa132 (patch)
treea1ca801457c9ac28e219752790475eaabffa9ea0 /src/compiler/scala/tools/nsc/transform/Delambdafy.scala
parent9f142b114be1261f55ea82b9cd1f9d9f91b3cad6 (diff)
downloadscala-d6b1e6e4ff1cb477e9b26ba7e1a02d1ea98fa132.tar.gz
scala-d6b1e6e4ff1cb477e9b26ba7e1a02d1ea98fa132.tar.bz2
scala-d6b1e6e4ff1cb477e9b26ba7e1a02d1ea98fa132.zip
SI-6260 Adddress pull request review
- fix typo - remove BRIDGE flag from the method that we promote from a bridge to a bona-fide method - note possibility for delambdafy to avoid the bridge method creation in *all* cases. - note inconsistency with anonymous class naming between `-Ydelamdafy:{inline,method}`
Diffstat (limited to 'src/compiler/scala/tools/nsc/transform/Delambdafy.scala')
-rw-r--r--src/compiler/scala/tools/nsc/transform/Delambdafy.scala8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/transform/Delambdafy.scala b/src/compiler/scala/tools/nsc/transform/Delambdafy.scala
index b28a4a507d..d81a5d5755 100644
--- a/src/compiler/scala/tools/nsc/transform/Delambdafy.scala
+++ b/src/compiler/scala/tools/nsc/transform/Delambdafy.scala
@@ -232,6 +232,10 @@ abstract class Delambdafy extends Transform with TypingTransformers with ast.Tre
val parents = addSerializable(abstractFunctionErasedType)
val funOwner = originalFunction.symbol.owner
+ // TODO harmonize the naming of delamdafy anon-fun classes with those spun up by Uncurry
+ // - make `anonClass.isAnonymousClass` true.
+ // - use `newAnonymousClassSymbol` or push the required variations into a similar factory method
+ // - reinstate the assertion in `Erasure.resolveAnonymousBridgeClash`
val suffix = "$lambda$" + (
if (funOwner.isPrimaryConstructor) ""
else "$" + funOwner.name
@@ -283,8 +287,10 @@ abstract class Delambdafy extends Transform with TypingTransformers with ast.Tre
else s"$sym: ${sym.tpe} in ${sym.owner}"
bridgeMethod foreach (bm =>
+ // TODO SI-6260 maybe just create the apply method with the signature (Object => Object) in all cases
+ // rather than the method+bridge pair.
if (bm.symbol.tpe =:= applyMethodDef.symbol.tpe)
- erasure.expandNameOfMethodThatClashesBridge(applyMethodDef.symbol)
+ erasure.resolveAnonymousBridgeClash(applyMethodDef.symbol, bm.symbol)
)
val body = members ++ List(constr, applyMethodDef) ++ bridgeMethod