File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed
compiler/src/dotty/tools/dotc Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -308,7 +308,10 @@ object Phases {
308308 def runOn (units : List [CompilationUnit ])(using Context ): List [CompilationUnit ] =
309309 units.map { unit =>
310310 val unitCtx = ctx.fresh.setPhase(this .start).setCompilationUnit(unit).withRootImports
311- run(using unitCtx)
311+ try run(using unitCtx)
312+ catch case ex : Throwable =>
313+ println(s " $ex while running $phaseName on $unit" )
314+ throw ex
312315 unitCtx.compilationUnit
313316 }
314317
Original file line number Diff line number Diff line change @@ -38,8 +38,8 @@ class TyperPhase(addRootImports: Boolean = true) extends Phase {
3838 }
3939
4040 def typeCheck (using Context ): Unit = monitor(" typechecking" ) {
41+ val unit = ctx.compilationUnit
4142 try
42- val unit = ctx.compilationUnit
4343 if ! unit.suspended then
4444 unit.tpdTree = ctx.typer.typedExpr(unit.untpdTree)
4545 typr.println(" typed: " + unit.source)
@@ -48,6 +48,9 @@ class TyperPhase(addRootImports: Boolean = true) extends Phase {
4848 ctx.run.nn.suppressions.reportSuspendedMessages(unit.source)
4949 catch
5050 case ex : CompilationUnit .SuspendException =>
51+ case ex : Throwable =>
52+ println(s " $ex while typechecking $unit" )
53+ throw ex
5154 }
5255
5356 def javaCheck (using Context ): Unit = monitor(" checking java" ) {
You can’t perform that action at this time.
0 commit comments