diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2014-02-10 08:59:22 +0100 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2014-02-10 09:06:45 +0100 |
commit | d6b1e6e4ff1cb477e9b26ba7e1a02d1ea98fa132 (patch) | |
tree | a1ca801457c9ac28e219752790475eaabffa9ea0 /src/compiler/scala/tools/nsc/transform/Erasure.scala | |
parent | 9f142b114be1261f55ea82b9cd1f9d9f91b3cad6 (diff) | |
download | scala-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/Erasure.scala')
-rw-r--r-- | src/compiler/scala/tools/nsc/transform/Erasure.scala | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/transform/Erasure.scala b/src/compiler/scala/tools/nsc/transform/Erasure.scala index e2ffafb850..60c1553ef3 100644 --- a/src/compiler/scala/tools/nsc/transform/Erasure.scala +++ b/src/compiler/scala/tools/nsc/transform/Erasure.scala @@ -484,7 +484,7 @@ abstract class Erasure extends AddInterfaces !sigContainsValueClass || (checkBridgeOverrides(member, other, bridge) match { case Nil => true - case es if member.owner.isAnonymousClass => expandNameOfMethodThatClashesBridge(member); true + case es if member.owner.isAnonymousClass => resolveAnonymousBridgeClash(member, bridge); true case es => for ((pos, msg) <- es) unit.error(pos, msg); false }) ) @@ -1137,9 +1137,12 @@ abstract class Erasure extends AddInterfaces } } - final def expandNameOfMethodThatClashesBridge(sym: Symbol) { + final def resolveAnonymousBridgeClash(sym: Symbol, bridge: Symbol) { + // TODO reinstate this after Delambdafy generates anonymous classes that meet this requirement. + // require(sym.owner.isAnonymousClass, sym.owner) log(s"Expanding name of ${sym.debugLocationString} as it clashes with bridge. Renaming deemed safe because the owner is anonymous.") sym.expandName(sym.owner) + bridge.resetFlag(BRIDGE) } private class TypeRefAttachment(val tpe: TypeRef) |