You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: compiler/src/dotty/tools/dotc/typer/Typer.scala
+7-7Lines changed: 7 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -2817,20 +2817,20 @@ class Typer extends Namer
2817
2817
readaptSimplified(Inliner.inlineCall(tree))
2818
2818
}
2819
2819
elseif (tree.symbol.isScala2Macro) {
2820
-
if (ctx.settings.XignoreScala2Macros.value) {
2821
-
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.startPos)
2822
-
Throw(New(defn.MatchErrorType, Literal(Constant(s"Reached unexpanded Scala 2 macro call to ${tree.symbol.showFullName} compiled with -Xignore-scala2-macros.")) ::Nil))
2823
-
.withType(tree.tpe)
2824
-
.withSpan(tree.span)
2825
-
} elseif (tree.symbol eq defn.StringContext_f) {
2820
+
if (tree.symbol eq defn.StringContext_f) {
2826
2821
// As scala.StringContext.f is defined in the standard library which
2827
-
// we currently do not bootstrap we cannot implement the macro the library.
2822
+
// we currently do not bootstrap we cannot implement the macro in the library.
2828
2823
// To overcome the current limitation we intercept the call and rewrite it into
2829
2824
// a call to dotty.internal.StringContext.f which we can implement using the new macros.
2830
2825
// As the macro is implemented in the bootstrapped library, it can only be used from the bootstrapped compiler.
2831
2826
valApply(TypeApply(Select(sc, _), _), args) = tree
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.startPos)
2831
+
Throw(New(defn.MatchErrorType, Literal(Constant(s"Reached unexpanded Scala 2 macro call to ${tree.symbol.showFullName} compiled with -Xignore-scala2-macros.")) ::Nil))
2832
+
.withType(tree.tpe)
2833
+
.withSpan(tree.span)
2834
2834
} else {
2835
2835
ctx.error(
2836
2836
"""Scala 2 macro cannot be used in Dotty. See http://dotty.epfl.ch/docs/reference/dropped-features/macros.html\n"
0 commit comments