From e2a05a5ac38647f9727d1e0ec8c3c14ac82b5de7 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Tue, 27 Aug 2013 14:12:31 +0200 Subject: Fixed bugs related to typechecking closures. --- src/dotty/tools/dotc/printing/RefinedPrinter.scala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/dotty/tools/dotc/printing') diff --git a/src/dotty/tools/dotc/printing/RefinedPrinter.scala b/src/dotty/tools/dotc/printing/RefinedPrinter.scala index 79641d932..3ee86f665 100644 --- a/src/dotty/tools/dotc/printing/RefinedPrinter.scala +++ b/src/dotty/tools/dotc/printing/RefinedPrinter.scala @@ -171,8 +171,8 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) { "if " ~ toText(cond) ~ (" then" provided !cond.isInstanceOf[Parens]) ~~ toText(thenp) ~ optText(elsep)(" else " ~ _) } case Closure(env, ref, _) => - if (env.isEmpty) toText(ref) - else "closure<" ~ toTextGlobal(env, ", ") ~ " | " ~ toTextGlobal(ref) ~ ">" + "closure(" ~ (toTextGlobal(env, ", ") ~ " | " provided env.nonEmpty) ~ + toTextGlobal(ref) ~ ")" case Match(sel, cases) => if (sel.isEmpty) blockText(cases) else changePrec(GlobalPrec) { toText(sel) ~ " match " ~ blockText(cases) } -- cgit v1.2.3