aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/Printers.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2013-03-12 09:04:57 +0100
committerMartin Odersky <odersky@gmail.com>2013-03-12 09:04:57 +0100
commitbf8e854c9f2dc2b03be5a44c84183af21510e6ef (patch)
treed9e59bd6415405b93662adce334d87c626c38980 /src/dotty/tools/dotc/core/Printers.scala
parentf02b4183a9a3d8fb7147e1aa1c74a5f102739d97 (diff)
downloaddotty-bf8e854c9f2dc2b03be5a44c84183af21510e6ef.tar.gz
dotty-bf8e854c9f2dc2b03be5a44c84183af21510e6ef.tar.bz2
dotty-bf8e854c9f2dc2b03be5a44c84183af21510e6ef.zip
Split filterAsSeenFrom and generalized flag handling.
1. filterAsSeenFrom has been split again into its constituents "filterExcluded" and "asSeenFrom", and care was taken not to force the info unless we have to. The accessible check is no longer done when collecting members, because it would have forced the symbol through requesting privateWithin. 2. SymDenotation#is is tweaked to no longer force the denotation if the flags are in "FromStartFlags", i.e. set upon symbol creation. We can then eliminate special cases isModuleXXX, isPackageXXX. 3. Other tweaks mostly having to do with weakening sym.exists checks to avoid CyclicReference errros.
Diffstat (limited to 'src/dotty/tools/dotc/core/Printers.scala')
-rw-r--r--src/dotty/tools/dotc/core/Printers.scala16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/dotty/tools/dotc/core/Printers.scala b/src/dotty/tools/dotc/core/Printers.scala
index 25fa2ca01..0b1d951aa 100644
--- a/src/dotty/tools/dotc/core/Printers.scala
+++ b/src/dotty/tools/dotc/core/Printers.scala
@@ -282,13 +282,13 @@ object Printers {
/** Show kind of symbol */
def showKind(sym: Symbol) =
- if (sym.isPackageClass) "package class"
- else if (sym.isPackageVal) "package"
+ if (sym is PackageClass) "package class"
+ else if (sym is PackageVal) "package"
else if (sym is PackageObjectClass) "package object class"
else if (sym is PackageObjectVal) "package object"
else if (sym.isAnonymousClass) "anonymous class"
- else if (sym.isModuleClass) "module class"
- else if (sym.isModuleVal) "module"
+ else if (sym is ModuleClass) "module class"
+ else if (sym is ModuleVal) "module"
else if (sym is ImplClass) "implementation class"
else if (sym is Trait) "trait"
else if (sym.isClass) "class"
@@ -310,8 +310,8 @@ object Printers {
else if (sym.isClass) "class"
else if (sym.isType && !(sym is ExpandedTypeParam)) "type"
else if (sym is Mutable) "var"
- else if (sym.isPackage) "package"
- else if (sym.isModule) "object"
+ else if (sym is Package) "package"
+ else if (sym is Module) "object"
else if (sym.isSourceMethod) "def"
else if (sym.isTerm && (!(sym is Param))) "val"
else ""
@@ -406,7 +406,7 @@ object Printers {
case ThisType(cls) =>
if (cls.isAnonymousClass) return "this."
if (isOmittablePrefix(cls)) return ""
- if (cls.isModuleClass) return showFullName(cls) + "."
+ if (cls is ModuleClass) return showFullName(cls) + "."
case tp @ TermRef(pre, name) =>
val sym = tp.symbol
if (sym is PackageObject) return showPrefix(pre)
@@ -458,7 +458,7 @@ object Printers {
}
override def showKind(sym: Symbol) =
- if (sym.isPackage) "package"
+ if (sym is Package) "package"
else if (sym is PackageObject) "package object"
else if (sym is Module) "object"
else if (sym is ImplClass) "class"