aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/printing
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2013-08-19 16:19:03 +0200
committerMartin Odersky <odersky@gmail.com>2013-08-19 16:19:03 +0200
commit62131749d08657a0103c922c626a0b918cf385b5 (patch)
treee8c49a9bb6eb41f3f5d4e3ca7e75a431a25c33b9 /src/dotty/tools/dotc/printing
parentedb9facac55f61540e0f9af8d06ac9390830fcb8 (diff)
downloaddotty-62131749d08657a0103c922c626a0b918cf385b5.tar.gz
dotty-62131749d08657a0103c922c626a0b918cf385b5.tar.bz2
dotty-62131749d08657a0103c922c626a0b918cf385b5.zip
Several fixes and refactorings for typechecking
1) Refactoring of package loaders that ensures that a package is always loaded before new members are entered. This led to a refactoring of sourceModule in completers into its own trait 2) Refactoring of optSelfType ot selfInfo. Class Infos may now have a reference to a symbol in their selfInfo field, instead of always a type, as it was before. This allows to introduce laziness for self type evaluation. Laziness is needed so that modules can be desugared and the desugared version be compiled without special tricks. 3) <init> and $init members are no longer inherited. 4) Refactoring of createSymbol and enterSym, so that creating symbols and entering them in a scope is decoupled. Renamed the driver operation form `enterSym(s)` to `index`.
Diffstat (limited to 'src/dotty/tools/dotc/printing')
-rw-r--r--src/dotty/tools/dotc/printing/PlainPrinter.scala6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/dotty/tools/dotc/printing/PlainPrinter.scala b/src/dotty/tools/dotc/printing/PlainPrinter.scala
index fe67f5b89..9e5786126 100644
--- a/src/dotty/tools/dotc/printing/PlainPrinter.scala
+++ b/src/dotty/tools/dotc/printing/PlainPrinter.scala
@@ -204,14 +204,14 @@ class PlainPrinter(_ctx: Context) extends Printer {
else
(if (lo == defn.NothingType) Text() else " >: " ~ toText(lo)) ~
(if (hi == defn.AnyType) Text() else " <: " ~ toText(hi))
- case ClassInfo(pre, cls, cparents, decls, optSelfType) =>
+ case tp @ ClassInfo(pre, cls, cparents, decls, selfInfo) =>
val preText = toTextLocal(pre)
val (tparams, otherDecls) = decls.toList partition treatAsTypeParam
val tparamsText =
if (tparams.isEmpty) Text() else ("[" ~ dclsText(tparams) ~ "]").close
val selfText =
- if (optSelfType.exists)
- "this: " ~ atPrec(InfixPrec) { toText(optSelfType) } ~ " =>"
+ if (selfInfo ne NoType)
+ "this: " ~ atPrec(InfixPrec) { toText(tp.selfType) } ~ " =>"
else Text()
val parentsText = Text(cparents.map(p =>
toTextLocal(reconstituteParent(cls, p))), " with ")