@@ -6,7 +6,7 @@ import dotty.tools.dotc.core.Contexts.{Context, ContextBase, FreshContext}
6
6
import dotty .tools .dotc .tastyreflect .ReflectionImpl
7
7
import dotty .tools .io .{AbstractFile , Directory , PlainDirectory , VirtualDirectory }
8
8
import dotty .tools .repl .AbstractFileClassLoader
9
-
9
+ import dotty . tools . dotc . reporting . _
10
10
import scala .quoted .{Expr , Type }
11
11
import scala .quoted .Toolbox
12
12
import java .net .URLClassLoader
@@ -61,7 +61,6 @@ class QuoteDriver(appClassloader: ClassLoader) extends Driver {
61
61
def show (tpe : Type [_], settings : Toolbox .Settings ): String =
62
62
withTypeTree(tpe, doShow, settings)
63
63
64
-
65
64
def withTree [T ](expr : Expr [_], f : (Tree , Context ) => T , settings : Toolbox .Settings ): T = {
66
65
val ctx = setToolboxSettings(setup(settings.compilerArgs.toArray :+ " dummy.scala" , initCtx.fresh)._2.fresh, settings)
67
66
@@ -95,6 +94,9 @@ class QuoteDriver(appClassloader: ClassLoader) extends Driver {
95
94
private def setToolboxSettings (ctx : FreshContext , settings : Toolbox .Settings ): ctx.type = {
96
95
ctx.setSetting(ctx.settings.color, if (settings.color) " always" else " never" )
97
96
ctx.setSetting(ctx.settings.YshowRawQuoteTrees , settings.showRawTree)
97
+ // An error in the generated code is a bug in the compiler
98
+ // Setting the throwing reporter however will report any exception
99
+ ctx.setReporter(new ThrowingReporter (ctx.reporter))
98
100
}
99
101
}
100
102
0 commit comments