diff options
author | Martin Odersky <odersky@gmail.com> | 2013-08-19 18:28:02 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2013-08-19 18:28:02 +0200 |
commit | aa9ffac0042ed1ab95b5820dfac44a0de0df398c (patch) | |
tree | 77f6f00706c067bdfabec56e1e944dc01e9d3b69 /src/dotty/tools/dotc/printing | |
parent | d1fd45edec3ca301cc0bda499ffb4229aae2d614 (diff) | |
download | dotty-aa9ffac0042ed1ab95b5820dfac44a0de0df398c.tar.gz dotty-aa9ffac0042ed1ab95b5820dfac44a0de0df398c.tar.bz2 dotty-aa9ffac0042ed1ab95b5820dfac44a0de0df398c.zip |
Fixed printing of self types tto prevent cyclic reference errors.
Diffstat (limited to 'src/dotty/tools/dotc/printing')
-rw-r--r-- | src/dotty/tools/dotc/printing/PlainPrinter.scala | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/dotty/tools/dotc/printing/PlainPrinter.scala b/src/dotty/tools/dotc/printing/PlainPrinter.scala index 9e5786126..f2ddae42f 100644 --- a/src/dotty/tools/dotc/printing/PlainPrinter.scala +++ b/src/dotty/tools/dotc/printing/PlainPrinter.scala @@ -209,10 +209,11 @@ class PlainPrinter(_ctx: Context) extends Printer { val (tparams, otherDecls) = decls.toList partition treatAsTypeParam val tparamsText = if (tparams.isEmpty) Text() else ("[" ~ dclsText(tparams) ~ "]").close - val selfText = - if (selfInfo ne NoType) - "this: " ~ atPrec(InfixPrec) { toText(tp.selfType) } ~ " =>" - else Text() + val selfText: Text = selfInfo match { + case NoType => Text() + case sym: Symbol if !sym.isCompleted => "this: ? =>" + case _ => "this: " ~ atPrec(InfixPrec) { toText(tp.selfType) } ~ " =>" + } val parentsText = Text(cparents.map(p => toTextLocal(reconstituteParent(cls, p))), " with ") val trueDecls = otherDecls.filterNot(treatAsTypeArg) |