Skip to content

Commit b34ea5d

Browse files
Merge pull request #6463 from dotty-staging/improve-runtime-crashes-when-using-Xignore-scala2-macros
Improve runtime crashes when using -Xignore-scala2-macros
2 parents 53302f2 + 11e75db commit b34ea5d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compiler/src/dotty/tools/dotc/typer/Typer.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2777,7 +2777,7 @@ class Typer extends Namer
27772777
else if (tree.symbol.isScala2Macro) {
27782778
if (ctx.settings.XignoreScala2Macros.value) {
27792779
ctx.warning("Scala 2 macro cannot be used in Dotty, this call will crash at runtime. See http://dotty.epfl.ch/docs/reference/dropped-features/macros.html", tree.sourcePos)
2780-
tree
2780+
Throw(New(defn.MatchErrorType, Literal(Constant(s"Reached unexpanded Scala 2 macro call to ${tree.symbol.showFullName} compiled with -Xignore-scala2-macros.")) :: Nil)).withSpan(tree.span)
27812781
} else if (tree.symbol eq defn.StringContext_f) {
27822782
// As scala.StringContext.f is defined in the standard library which
27832783
// we currently do not bootstrap we cannot implement the macro the library.

0 commit comments

Comments
 (0)