diff options
author | Martin Odersky <odersky@gmail.com> | 2014-01-17 19:12:32 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2014-01-17 19:12:54 +0100 |
commit | 08880b3ce03fa8f9a4b23671ef5d1d78816d28c5 (patch) | |
tree | acc06d05ff9d49804c80aaa940a9da647ec8b553 /src/dotty/tools/dotc/typer/Inferencing.scala | |
parent | ba1c6fa888488774a7e510ee09ebb80ff0ce2a3c (diff) | |
download | dotty-08880b3ce03fa8f9a4b23671ef5d1d78816d28c5.tar.gz dotty-08880b3ce03fa8f9a4b23671ef5d1d78816d28c5.tar.bz2 dotty-08880b3ce03fa8f9a4b23671ef5d1d78816d28c5.zip |
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.
Diffstat (limited to 'src/dotty/tools/dotc/typer/Inferencing.scala')
-rw-r--r-- | src/dotty/tools/dotc/typer/Inferencing.scala | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/dotty/tools/dotc/typer/Inferencing.scala b/src/dotty/tools/dotc/typer/Inferencing.scala index e8a2548ae..6390ed51e 100644 --- a/src/dotty/tools/dotc/typer/Inferencing.scala +++ b/src/dotty/tools/dotc/typer/Inferencing.scala @@ -402,8 +402,8 @@ object Inferencing { typr.println(i"conflict? $decl $other") if (decl.signature matches other.signature) { def doubleDefError(decl: Symbol, other: Symbol): Unit = { - val ofType = if (decl.isType) "" else i": ${other.info}" - val explanation = + def ofType = if (decl.isType) "" else i": ${other.info}" + def explanation = if (!decl.isSourceMethod) "" else "\n (both definitions have the same erased type signature)" ctx.error(i"$decl is already defined as $other$ofType$explanation", decl.pos) |