Skip to content

Commit

Permalink
Merge pull request #6463 from dotty-staging/improve-runtime-crashes-w…
Browse files Browse the repository at this point in the history
…hen-using-Xignore-scala2-macros

Improve runtime crashes when using -Xignore-scala2-macros
  • Loading branch information
nicolasstucki committed May 6, 2019
2 parents 53302f2 + 11e75db commit b34ea5d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/typer/Typer.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2777,7 +2777,7 @@ class Typer extends Namer
else if (tree.symbol.isScala2Macro) {
if (ctx.settings.XignoreScala2Macros.value) {
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)
tree
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)
} else if (tree.symbol eq defn.StringContext_f) {
// As scala.StringContext.f is defined in the standard library which
// we currently do not bootstrap we cannot implement the macro the library.
Expand Down

0 comments on commit b34ea5d

Please sign in to comment.