summaryrefslogtreecommitdiff
path: root/src/compiler
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2010-10-16 14:49:52 +0000
committerMartin Odersky <odersky@gmail.com>2010-10-16 14:49:52 +0000
commitb525978a52a4ebf8ec32cae77fb2b0f579da667c (patch)
treef627e9f3a2918998c3d4bd7dfc35eeba18bf6f22 /src/compiler
parente5cfe47a191bd0e5aaac07f8910dd0916b060d26 (diff)
downloadscala-b525978a52a4ebf8ec32cae77fb2b0f579da667c.tar.gz
scala-b525978a52a4ebf8ec32cae77fb2b0f579da667c.tar.bz2
scala-b525978a52a4ebf8ec32cae77fb2b0f579da667c.zip
Closes #3837. Review by extempore.
Diffstat (limited to 'src/compiler')
-rw-r--r--src/compiler/scala/tools/nsc/symtab/Symbols.scala10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/compiler/scala/tools/nsc/symtab/Symbols.scala b/src/compiler/scala/tools/nsc/symtab/Symbols.scala
index 60ae6b3f07..1933893373 100644
--- a/src/compiler/scala/tools/nsc/symtab/Symbols.scala
+++ b/src/compiler/scala/tools/nsc/symtab/Symbols.scala
@@ -629,11 +629,15 @@ trait Symbols extends reflect.generic.Symbols { self: SymbolTable =>
def next = { val r = current; current = current.owner; r }
}
- // same as ownerChain contains sym, but more efficient
- def hasTransOwner(sym: Symbol) = {
+ /** same as ownerChain contains sym, but more efficient, and
+ * with a twist for refinement classes. A refinement class
+ * has a transowner X if an of its parents has transowner X.
+ */
+ def hasTransOwner(sym: Symbol): Boolean = {
var o = this
while ((o ne sym) && (o ne NoSymbol)) o = o.owner
- o eq sym
+ (o eq sym) ||
+ isRefinementClass && (info.parents exists (_.typeSymbol.hasTransOwner(sym)))
}
def name: Name = rawname