summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2006-07-24 18:24:23 +0000
committerMartin Odersky <odersky@gmail.com>2006-07-24 18:24:23 +0000
commitadebb89dfa342f5626468a314d450e454d5714b4 (patch)
tree74d893b6a0d6f9516b4813de83d07cfc00c2ac65 /src
parent7b8adeb8ff472948aeabdedb641659a5972df94a (diff)
downloadscala-adebb89dfa342f5626468a314d450e454d5714b4.tar.gz
scala-adebb89dfa342f5626468a314d450e454d5714b4.tar.bz2
scala-adebb89dfa342f5626468a314d450e454d5714b4.zip
fixed bug 674, reverted fix to bug 669
Diffstat (limited to 'src')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Typers.scala9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
index e43c2b8554..93f9baafed 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
@@ -247,7 +247,10 @@ trait Typers requires Analyzer {
def checkNoEscape(sym: Symbol): unit = {
if (sym.hasFlag(PRIVATE)) {
var o = owner
- while (o != NoSymbol && o != sym.owner && !o.isLocal && !o.hasFlag(PRIVATE))
+ var leaking = true
+ while (o != NoSymbol && o != sym.owner &&
+ !o.isLocal && !o.hasFlag(PRIVATE) &&
+ !o.privateWithin.ownerChain.contains(sym.owner))
o = o.owner
if (o == sym.owner) badSymbol = sym
} else if (sym.owner.isTerm) {
@@ -1160,10 +1163,10 @@ trait Typers requires Analyzer {
if (!attrError) {
val attributed =
if (defn.symbol.isModule) defn.symbol.moduleClass else defn.symbol
-// if (attrInfos.length attributed.attributes.isEmpty) { does not work under resident!
+ if (attributed.attributes.isEmpty) { // Nik: this does not work under resident!
attributed.attributes = attrInfos
defn.mods setAttr List();
-// }
+ }
}
}