diff options
author | Martin Odersky <odersky@gmail.com> | 2012-08-11 19:29:53 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2012-08-11 19:29:53 +0200 |
commit | 5d4e4e29b90ae394f44bca4c1c7634f314b4f158 (patch) | |
tree | 42b3977973dac7b750337664294cac0cb7b99dca | |
parent | 4459e5abb2b765cbdca34eb19c5d8b705203f771 (diff) | |
download | scala-5d4e4e29b90ae394f44bca4c1c7634f314b4f158.tar.gz scala-5d4e4e29b90ae394f44bca4c1c7634f314b4f158.tar.bz2 scala-5d4e4e29b90ae394f44bca4c1c7634f314b4f158.zip |
Added make not private logic for @inline accesses back to ExplicitOuter.
As discussed in https://mail.google.com/mail/u/0/?hl=en&tab=Tm#search/inlining+changes+needed/1390c955960d7cb5, we need to move access widenings back to ExplicitOuter, so that outer fields are correctly widened. The previous logiv in SuperAccessors can go once the inliner is adapted to the new scheme. I leave SuperAccessors for the moment as is, in order not to slide back even further with inlining.
-rw-r--r-- | src/compiler/scala/tools/nsc/transform/ExplicitOuter.scala | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/transform/ExplicitOuter.scala b/src/compiler/scala/tools/nsc/transform/ExplicitOuter.scala index 8e928dc9e6..a06c3f78ea 100644 --- a/src/compiler/scala/tools/nsc/transform/ExplicitOuter.scala +++ b/src/compiler/scala/tools/nsc/transform/ExplicitOuter.scala @@ -497,7 +497,10 @@ abstract class ExplicitOuter extends InfoTransform else atPos(tree.pos)(outerPath(outerValue, currentClass.outerClass, sym)) // (5) case Select(qual, name) => - if (currentClass != sym.owner) + // make not private symbol acessed from inner classes, as well as + // symbols accessed from @inline methods + if (currentClass != sym.owner || + (sym.owner.enclMethod hasAnnotation ScalaInlineClass)) sym.makeNotPrivate(sym.owner) val qsym = qual.tpe.widen.typeSymbol |