Skip to content

Commit 7eb80b1

Browse files
committed
Remove report.StopQuotedContext
Replaced with scala.quoted.internal.StopMacroExpansion
1 parent 88541a3 commit 7eb80b1

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

compiler/src/dotty/tools/dotc/transform/Splicer.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ object Splicer {
6262
catch {
6363
case ex: CompilationUnit.SuspendException =>
6464
throw ex
65-
case ex: scala.quoted.report.StopQuotedContext if ctx.reporter.hasErrors =>
65+
case ex: scala.quoted.internal.StopMacroExpansion if ctx.reporter.hasErrors =>
6666
// errors have been emitted
6767
EmptyTree
6868
case ex: StopInterpretation =>
@@ -419,7 +419,7 @@ object Splicer {
419419
throw new StopInterpretation(sw.toString, pos)
420420
case ex: InvocationTargetException =>
421421
ex.getTargetException match {
422-
case ex: scala.quoted.report.StopQuotedContext =>
422+
case ex: scala.quoted.internal.StopMacroExpansion =>
423423
throw ex
424424
case MissingClassDefinedInCurrentRun(sym) if ctx.compilationUnit.isSuspendable =>
425425
if (ctx.settings.XprintSuspension.value)
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
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

library/src/scala/quoted/report.scala

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ object report:
1010
def error(msg: => String, expr: Expr[Any])(using qctx: QuoteContext): Unit =
1111
qctx.reflect.Reporting.error(msg, expr.unseal.pos)
1212

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 */
1414
def throwError(msg: => String)(using qctx: QuoteContext): Nothing = {
1515
error(msg)
16-
throw new StopQuotedContext
16+
throw new internal.StopMacroExpansion
1717
}
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 */
1919
def throwError(msg: => String, expr: Expr[Any])(using qctx: QuoteContext): Nothing = {
2020
error(msg, expr)
21-
throw new StopQuotedContext
21+
throw new internal.StopMacroExpansion
2222
}
2323

2424
/** Report a warning */
@@ -29,7 +29,4 @@ object report:
2929
def warning(msg: => String, expr: Expr[_])(using qctx: QuoteContext): Unit =
3030
qctx.reflect.Reporting.warning(msg, expr.unseal.pos)
3131

32-
/** Throwable used to stop the expansion of a macro after an error was reported */
33-
class StopQuotedContext extends Throwable
34-
3532
end report

0 commit comments

Comments
 (0)