File tree Expand file tree Collapse file tree 3 files changed +11
-10
lines changed
compiler/src/dotty/tools/dotc Expand file tree Collapse file tree 3 files changed +11
-10
lines changed Original file line number Diff line number Diff line change @@ -25,11 +25,11 @@ object ContextOps:
25
25
| message: ${ex.getMessage()}
26
26
| cause: ${ex.getCause()}
27
27
| (truncated) stack trace:
28
- | ${ex.getStackTrace().take(10 ).mkString(" \n " )}
28
+ | ${ex.getStackTrace().nn. take(10 ).nn .mkString(" \n " )}
29
29
|Sources:
30
- | ${ctx.base.sources.keysIterator.mkString(" \n " )}
30
+ | ${ctx.base.sources.keysIterator.mkString(" : " )}
31
31
|Files:
32
- | ${ctx.base.files.keysIterator.mkString(" \n " )}
32
+ | ${ctx.base.files.keysIterator.mkString(" : " )}
33
33
|Context:
34
34
| phase: ${ctx.phase}
35
35
| owner: ${ctx.owner}
Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ import ast.{tpd, untpd}
22
22
import scala .annotation .internal .sharable
23
23
import scala .util .control .NonFatal
24
24
import dotty .tools .dotc .core .ContextOps .*
25
+ import dotty .tools .dotc .CompilationUnit .SuspendException
25
26
26
27
27
28
object Phases {
@@ -324,9 +325,9 @@ object Phases {
324
325
units.map { unit =>
325
326
val unitCtx = ctx.fresh.setPhase(this .start).setCompilationUnit(unit).withRootImports
326
327
try run(using unitCtx)
327
- catch case ex : Throwable =>
328
+ catch case ex : Throwable if ! (ex. isInstanceOf [ Implosion ] || ex. isInstanceOf [ SuspendException ]) =>
328
329
unitCtx.implode(i " $ex while running $phaseName on $unit" , ex)
329
- throw ex
330
+
330
331
unitCtx.compilationUnit
331
332
}
332
333
Original file line number Diff line number Diff line change @@ -126,12 +126,12 @@ class ReTyper(nestingLevel: Int = 0) extends Typer(nestingLevel) with ReChecking
126
126
override def typedUnadapted (tree : untpd.Tree , pt : Type , locked : TypeVars )(using Context ): Tree =
127
127
try super .typedUnadapted(tree, pt, locked)
128
128
catch {
129
- case NonFatal (ex) =>
129
+ case NonFatal (ex) if ctx.phase != Phases .typerPhase && ctx.phase != Phases .inliningPhase =>
130
+ ctx.implode(
131
+ i " exception while typing $tree of class ${tree.getClass} # ${tree.uniqueId}" ,
132
+ ex
133
+ )
130
134
131
- val message = if ctx.phase != Phases .typerPhase && ctx.phase != Phases .inliningPhase then
132
- i " exception while typing $tree of class ${tree.getClass} # ${tree.uniqueId}"
133
- else " "
134
- ctx.implode(message, ex)
135
135
}
136
136
137
137
override def inlineExpansion (mdef : DefDef )(using Context ): List [Tree ] = mdef :: Nil
You can’t perform that action at this time.
0 commit comments