summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2012-08-09 20:04:31 +0200
committerMartin Odersky <odersky@gmail.com>2012-08-09 20:04:31 +0200
commitf71dca29e4b292d0df8c2cc616477dc6b4f522c1 (patch)
tree42ce595750b7c22d731780dab447d2aff2e165bc
parent0e2080e8bf1c54cac59c5b0c53a93eb0de009d3b (diff)
downloadscala-f71dca29e4b292d0df8c2cc616477dc6b4f522c1.tar.gz
scala-f71dca29e4b292d0df8c2cc616477dc6b4f522c1.tar.bz2
scala-f71dca29e4b292d0df8c2cc616477dc6b4f522c1.zip
Made inliner work for @inline methods that access private variables.
We need to disable the previous "potentiallyPublished" logic for this because that one disables inlining as long as the inlined method has a reference to a field with a $. But making fields public in @inline method will generate fields with $. We need to complement this with reverting the previous publication logic completely. I leave that to Vlad or Miguel.
-rw-r--r--src/compiler/scala/tools/nsc/backend/opt/Inliners.scala8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/compiler/scala/tools/nsc/backend/opt/Inliners.scala b/src/compiler/scala/tools/nsc/backend/opt/Inliners.scala
index d87a242f1b..5464b6fc3b 100644
--- a/src/compiler/scala/tools/nsc/backend/opt/Inliners.scala
+++ b/src/compiler/scala/tools/nsc/backend/opt/Inliners.scala
@@ -661,13 +661,15 @@ abstract class Inliners extends SubComponent {
*
* TODO handle more robustly the case of a trait var changed at the source-level from public to private[this]
* (eg by having ICodeReader use unpickler, see SI-5442).
- * */
+
+ DISABLED
+
def potentiallyPublicized(f: Symbol): Boolean = {
(m.sourceFile eq NoSourceFile) && f.name.containsChar('$')
}
+ */
- def checkField(f: Symbol) = check(f, potentiallyPublicized(f) ||
- (f.isPrivate && !canMakePublic(f)))
+ def checkField(f: Symbol) = check(f, f.isPrivate && !canMakePublic(f))
def checkSuper(n: Symbol) = check(n, n.isPrivate || !n.isClassConstructor)
def checkMethod(n: Symbol) = check(n, n.isPrivate)