diff options
author | Martin Odersky <odersky@gmail.com> | 2013-02-24 18:42:17 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2013-02-24 18:42:17 +0100 |
commit | 36b9128d2214a927d642e87da3322b4ed4e76c58 (patch) | |
tree | 8a9c85a5b7568bb5b1eb4113d0ab122ae1af1bc1 /src/dotty/tools/dotc/core/Printers.scala | |
parent | 7cde8b6d78022aadb00d3f82fb9019da39a62b49 (diff) | |
download | dotty-36b9128d2214a927d642e87da3322b4ed4e76c58.tar.gz dotty-36b9128d2214a927d642e87da3322b4ed4e76c58.tar.bz2 dotty-36b9128d2214a927d642e87da3322b4ed4e76c58.zip |
Refactoring and cleanup of several symbol creation related aspects.
1. Went back to old completer model where completers are types.
2. Made class denotations a simple optimzation of symbol denotatons (with more caches)
by moving all class-specific attributes into ClassInfo.
3. Now all symbol and symbol denotation creations are routed through one of 3 methods: newNakedSymbol, newNakedClassSymbol, newSymDenotation.
Diffstat (limited to 'src/dotty/tools/dotc/core/Printers.scala')
-rw-r--r-- | src/dotty/tools/dotc/core/Printers.scala | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/dotty/tools/dotc/core/Printers.scala b/src/dotty/tools/dotc/core/Printers.scala index 640e72d68..3a9aaeb5b 100644 --- a/src/dotty/tools/dotc/core/Printers.scala +++ b/src/dotty/tools/dotc/core/Printers.scala @@ -274,15 +274,15 @@ object Printers { else (if (lo.typeSymbol == defn.NothingClass) "" else ">: " + lo) + (if (hi.typeSymbol == defn.AnyClass) "" else "<: " + hi) - case ClassInfo(pre, cdenot) => + case ClassInfo(pre, cdenot, cparents, decls, optSelfType) => val preStr = showLocal(pre) val selfStr = - if (cdenot.selfType == cdenot.typeConstructor) "" - else s"this: ${show(cdenot.selfType, LeftArrowPrec)} =>" - val parentsStr = cdenot.parents.map(show(_, WithPrec)).mkString(" with ") + if (optSelfType.exists) s"this: ${show(optSelfType, LeftArrowPrec)} =>" + else "" + val parentsStr = cparents.map(show(_, WithPrec)).mkString(" with ") val declsStr = - if (cdenot.decls.isEmpty) "" - else "\n " + show(cdenot.decls.toList, "\n ") + if (decls.isEmpty) "" + else "\n " + show(decls.toList, "\n ") s"""$parentsStr { $selfStr$declsStr |} at $preStr""".stripMargin case _ => ": " + showGlobal(tp) |