diff options
author | Paul Phillips <paulp@improving.org> | 2011-03-03 08:57:49 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2011-03-03 08:57:49 +0000 |
commit | 290c7cd00832b9b8dee19a22130f8b4dea2cd503 (patch) | |
tree | 6a298b08637e77347dc3feadb91e10023ef9efb2 | |
parent | a296cefe0cac81ca75e9d019f3e023c1ab0bd474 (diff) | |
download | scala-290c7cd00832b9b8dee19a22130f8b4dea2cd503.tar.gz scala-290c7cd00832b9b8dee19a22130f8b4dea2cd503.tar.bz2 scala-290c7cd00832b9b8dee19a22130f8b4dea2cd503.zip |
A swing at fixing the remaining test without ta...
A swing at fixing the remaining test without taking any innocents down
with me. No review.
-rw-r--r-- | src/compiler/scala/tools/nsc/symtab/Symbols.scala | 4 | ||||
-rw-r--r-- | src/compiler/scala/tools/nsc/transform/Erasure.scala | 8 |
2 files changed, 8 insertions, 4 deletions
diff --git a/src/compiler/scala/tools/nsc/symtab/Symbols.scala b/src/compiler/scala/tools/nsc/symtab/Symbols.scala index e6b2c1e450..27eed6d577 100644 --- a/src/compiler/scala/tools/nsc/symtab/Symbols.scala +++ b/src/compiler/scala/tools/nsc/symtab/Symbols.scala @@ -607,6 +607,10 @@ trait Symbols extends reflect.generic.Symbols { self: SymbolTable => } def ownerChain: List[Symbol] = this :: owner.ownerChain + def enclClassChain: List[Symbol] = + if (this eq NoSymbol) Nil + else if (isClass) this :: owner.enclClassChain + else owner.enclClassChain def ownersIterator: Iterator[Symbol] = new Iterator[Symbol] { private var current = Symbol.this diff --git a/src/compiler/scala/tools/nsc/transform/Erasure.scala b/src/compiler/scala/tools/nsc/transform/Erasure.scala index a04f1d972c..096b646587 100644 --- a/src/compiler/scala/tools/nsc/transform/Erasure.scala +++ b/src/compiler/scala/tools/nsc/transform/Erasure.scala @@ -205,10 +205,10 @@ abstract class Erasure extends AddInterfaces // * higher-order type parameters (aka !sym.owner.isTypeParameterOrSkolem) // * parameters of methods // * type members not visible in the enclosing template - private def isTypeParameterInSig(sym: Symbol, nestedIn: Symbol) = ( + private def isTypeParameterInSig(sym: Symbol, enclosing: List[Symbol]) = ( !sym.owner.isTypeParameterOrSkolem && sym.isTypeParameterOrSkolem && - (sym isNestedIn nestedIn) + (enclosing exists (sym isNestedIn _)) ) // Ensure every '.' in the generated signature immediately follows // a close angle bracket '>'. Any which do not are replaced with '$'. @@ -274,7 +274,7 @@ abstract class Erasure extends AddInterfaces if (unboundedGenericArrayLevel(tp) == 1) jsig(ObjectClass.tpe) else ARRAY_TAG.toString+(args map jsig).mkString } - else if (isTypeParameterInSig(sym, sym0.enclClass)) + else if (isTypeParameterInSig(sym, sym0.enclClassChain)) TVAR_TAG.toString+sym.name+";" else if (sym == AnyClass || sym == AnyValClass || sym == SingletonClass) jsig(ObjectClass.tpe) @@ -338,7 +338,7 @@ abstract class Erasure extends AddInterfaces else jsig(etp) } } - traceSig("javaSig", sym0, info) { + traceSig("javaSig", sym0, info, sym0.enclClassChain) { if (needsJavaSig(info)) { try Some(jsig2(true, Nil, info)) catch { case ex: UnknownSig => None } |