From 08880b3ce03fa8f9a4b23671ef5d1d78816d28c5 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Fri, 17 Jan 2014 19:12:32 +0100 Subject: Avoid SuppressedError exceptions Note: "i" throws a supressed error to be caught in Reporters. Problem is this does not work if - "i" is evaluated in a val. That's normally an error anyway since error diagnostics should be evaluated lazily to avoid possibvly useless computation. - "i" is passed to a println in a Config.Printer. Not sure what to do about the latter. To avoid such an expression or handle it reasonably, we'd need access to the context base, which we do not have from Printers. --- src/dotty/tools/dotc/typer/Typer.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/dotty/tools/dotc/typer/Typer.scala') diff --git a/src/dotty/tools/dotc/typer/Typer.scala b/src/dotty/tools/dotc/typer/Typer.scala index c1e771f16..cc142e7bf 100644 --- a/src/dotty/tools/dotc/typer/Typer.scala +++ b/src/dotty/tools/dotc/typer/Typer.scala @@ -824,7 +824,7 @@ class Typer extends Namer with Applications with Implicits { def typedBind(tree: untpd.Bind, pt: Type)(implicit ctx: Context): Bind = track("typedBind") { val body1 = typed(tree.body, pt) - typr.println(i"typed bind $tree pt = $pt bodytpe = ${body1.tpe}") + typr.println(s"typed bind ${tree.show} pt = ${pt.show} bodytpe = ${body1.tpe.show}") val sym = ctx.newSymbol(ctx.owner, tree.name.asTermName, EmptyFlags, body1.tpe, coord = tree.pos) cpy.Bind(tree, tree.name, body1) withType TermRef(NoPrefix, sym) } -- cgit v1.2.3