File tree Expand file tree Collapse file tree 3 files changed +10
-9
lines changed
compiler/src/dotty/tools/dotc/transform Expand file tree Collapse file tree 3 files changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -62,7 +62,7 @@ object Splicer {
62
62
catch {
63
63
case ex : CompilationUnit .SuspendException =>
64
64
throw ex
65
- case ex : scala.quoted.report. StopQuotedContext if ctx.reporter.hasErrors =>
65
+ case ex : scala.quoted.internal. StopMacroExpansion if ctx.reporter.hasErrors =>
66
66
// errors have been emitted
67
67
EmptyTree
68
68
case ex : StopInterpretation =>
@@ -419,7 +419,7 @@ object Splicer {
419
419
throw new StopInterpretation (sw.toString, pos)
420
420
case ex : InvocationTargetException =>
421
421
ex.getTargetException match {
422
- case ex : scala.quoted.report. StopQuotedContext =>
422
+ case ex : scala.quoted.internal. StopMacroExpansion =>
423
423
throw ex
424
424
case MissingClassDefinedInCurrentRun (sym) if ctx.compilationUnit.isSuspendable =>
425
425
if (ctx.settings.XprintSuspension .value)
Original file line number Diff line number Diff line change
1
+ package scala .quoted .internal
2
+
3
+ /** Throwable used to stop the expansion of a macro after an error was reported */
4
+ class StopMacroExpansion extends Throwable
Original file line number Diff line number Diff line change @@ -10,15 +10,15 @@ object report:
10
10
def error (msg : => String , expr : Expr [Any ])(using qctx : QuoteContext ): Unit =
11
11
qctx.reflect.Reporting .error(msg, expr.unseal.pos)
12
12
13
- /** Report an error at the position of the macro expansion and throws a StopQuotedContext */
13
+ /** Report an error at the position of the macro expansion and throws a StopMacroExpansion */
14
14
def throwError (msg : => String )(using qctx : QuoteContext ): Nothing = {
15
15
error(msg)
16
- throw new StopQuotedContext
16
+ throw new internal. StopMacroExpansion
17
17
}
18
- /** Report an error at the on the position of `expr` and throws a StopQuotedContext */
18
+ /** Report an error at the on the position of `expr` and throws a StopMacroExpansion */
19
19
def throwError (msg : => String , expr : Expr [Any ])(using qctx : QuoteContext ): Nothing = {
20
20
error(msg, expr)
21
- throw new StopQuotedContext
21
+ throw new internal. StopMacroExpansion
22
22
}
23
23
24
24
/** Report a warning */
@@ -29,7 +29,4 @@ object report:
29
29
def warning (msg : => String , expr : Expr [_])(using qctx : QuoteContext ): Unit =
30
30
qctx.reflect.Reporting .warning(msg, expr.unseal.pos)
31
31
32
- /** Throwable used to stop the expansion of a macro after an error was reported */
33
- class StopQuotedContext extends Throwable
34
-
35
32
end report
You can’t perform that action at this time.
0 commit comments