aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/printing
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2013-05-22 16:38:04 +0200
committerMartin Odersky <odersky@gmail.com>2013-05-22 16:44:28 +0200
commit0ebdcc7ed2d2024d93ba7d24b88187d4c502eb4b (patch)
treee76375245f790a2606a70cda6c69c6bd70ca49a4 /src/dotty/tools/dotc/printing
parent62fe4b6ec456b4878a642aa7e98886b0c9d4c9dd (diff)
downloaddotty-0ebdcc7ed2d2024d93ba7d24b88187d4c502eb4b.tar.gz
dotty-0ebdcc7ed2d2024d93ba7d24b88187d4c502eb4b.tar.bz2
dotty-0ebdcc7ed2d2024d93ba7d24b88187d4c502eb4b.zip
Added desugaring.
With various other small changes.
Diffstat (limited to 'src/dotty/tools/dotc/printing')
-rw-r--r--src/dotty/tools/dotc/printing/RefinedPrinter.scala7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/printing/RefinedPrinter.scala b/src/dotty/tools/dotc/printing/RefinedPrinter.scala
index 88cc33c40..32f5f2d2f 100644
--- a/src/dotty/tools/dotc/printing/RefinedPrinter.scala
+++ b/src/dotty/tools/dotc/printing/RefinedPrinter.scala
@@ -104,6 +104,11 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) {
def forText(enums: List[Tree[T]], expr: Tree[T], sep: String): Text =
changePrec(GlobalPrec) { "for " ~ toText(enums, "; ") ~ sep ~ toText(expr) }
+ def cxBoundToText(bound: Tree[T]): Text = bound match {
+ case AppliedTypeTree(tpt, _) => " : " ~ toText(tpt)
+ case untpd.Function(_, tpt) => " <% " ~ toText(tpt)
+ }
+
val txt: Text = tree match {
case id: BackquotedIdent[_] =>
"`" ~ toText(id.name) ~ "`"
@@ -299,7 +304,7 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) {
toText(pat) ~ " = " ~ toText(expr)
case untpd.ContextBounds(bounds, cxBounds) =>
(toText(bounds) /: cxBounds) {(t, cxb) =>
- t ~ " : " ~ toText(cxb)
+ t ~ cxBoundToText(cxb)
}
case untpd.PatDef(mods, pats, tpt, rhs) =>
toText(mods, "val") ~~ toText(pats, ", ") ~ optText(tpt)(": " ~ _) ~