diff options
author | Lukas Rytz <lukas.rytz@typesafe.com> | 2014-11-10 11:02:09 +0100 |
---|---|---|
committer | Lukas Rytz <lukas.rytz@typesafe.com> | 2014-11-10 11:02:09 +0100 |
commit | 22bc1f89c13eceaf5d19821995a255e43ebabd77 (patch) | |
tree | dff9d5d6504de8e5e9655fc485fa3dcc552fa250 /src/compiler | |
parent | fad969e211965b10313611436832ca8066d690ef (diff) | |
parent | 8d84b62fc9ca2bc01c7e3119088ddac185695124 (diff) | |
download | scala-22bc1f89c13eceaf5d19821995a255e43ebabd77.tar.gz scala-22bc1f89c13eceaf5d19821995a255e43ebabd77.tar.bz2 scala-22bc1f89c13eceaf5d19821995a255e43ebabd77.zip |
Merge pull request #4095 from retronym/ticket/8933
Fix problems in Symbol Literal static caching
Diffstat (limited to 'src/compiler')
-rw-r--r-- | src/compiler/scala/tools/nsc/transform/CleanUp.scala | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/transform/CleanUp.scala b/src/compiler/scala/tools/nsc/transform/CleanUp.scala index 1664fe0e0d..c29826551b 100644 --- a/src/compiler/scala/tools/nsc/transform/CleanUp.scala +++ b/src/compiler/scala/tools/nsc/transform/CleanUp.scala @@ -520,7 +520,9 @@ abstract class CleanUp extends Statics with Transform with ast.TreeDSL { * And, finally, be advised - Scala's Symbol literal (scala.Symbol) and the Symbol class of the compiler * have little in common. */ - case Apply(fn, (arg @ Literal(Constant(symname: String))) :: Nil) if fn.symbol == Symbol_apply => + case Apply(fn @ Select(qual, _), (arg @ Literal(Constant(symname: String))) :: Nil) + if treeInfo.isQualifierSafeToElide(qual) && fn.symbol == Symbol_apply && !currentClass.isTrait => + def transformApply = { // add the symbol name to a map if it's not there already val rhs = gen.mkMethodCall(Symbol_apply, arg :: Nil) |