aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/SymDenotations.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2014-06-12 16:58:22 +0200
committerMartin Odersky <odersky@gmail.com>2014-06-12 16:58:22 +0200
commit8db6b3e3c28f671942d4a05ec7cd8848c2dd7fa9 (patch)
tree689e007bcd4bf6aee1228fd82a465e947b89b978 /src/dotty/tools/dotc/core/SymDenotations.scala
parentc1b884bbf80bc4c906ada08904d83510f2322ae7 (diff)
downloaddotty-8db6b3e3c28f671942d4a05ec7cd8848c2dd7fa9.tar.gz
dotty-8db6b3e3c28f671942d4a05ec7cd8848c2dd7fa9.tar.bz2
dotty-8db6b3e3c28f671942d4a05ec7cd8848c2dd7fa9.zip
Harden allOverriddenSymbols
Now also works for symbols that are not class members (and returns Iterator.empty for them).
Diffstat (limited to 'src/dotty/tools/dotc/core/SymDenotations.scala')
-rw-r--r--src/dotty/tools/dotc/core/SymDenotations.scala7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/core/SymDenotations.scala b/src/dotty/tools/dotc/core/SymDenotations.scala
index 46484e6cc..802762045 100644
--- a/src/dotty/tools/dotc/core/SymDenotations.scala
+++ b/src/dotty/tools/dotc/core/SymDenotations.scala
@@ -321,9 +321,14 @@ object SymDenotations {
final def isAnonymousClass(implicit ctx: Context): Boolean =
initial.asSymDenotation.name startsWith tpnme.ANON_CLASS
+ /** Is this symbol a class representing a refinement? These classes
+ * are used only temporarily in Typer and Unpickler as an intermediate
+ * step for creating Refinement types.
+ */
final def isRefinementClass(implicit ctx: Context): Boolean =
name.decode == tpnme.REFINE_CLASS
+ /** is this symbol a trait representing a type lambda? */
final def isLambdaTrait(implicit ctx: Context): Boolean =
isClass && name.startsWith(tpnme.LambdaPrefix)
@@ -702,7 +707,7 @@ object SymDenotations {
/** All symbols overriden by this denotation. */
final def allOverriddenSymbols(implicit ctx: Context): Iterator[Symbol] =
- if (exists)
+ if (exists && owner.isClass)
owner.info.baseClasses.tail.iterator map overriddenSymbol filter (_.exists)
else
Iterator.empty