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
is(Macro, butNot =Inline) && flagsUNSAFE.is(Erased) // flag is set initially for macros - we check if it's a scala 2 macro before completing the type constructor so do not force the info to check the flag
1062
-
// Consider the macros of StringContext as plain Scala 2 macros when
1063
-
// compiling the standard library with Dotty.
1064
-
// This should be removed on Scala 3.x
1065
-
&& owner.ne(defn.StringContextClass)
1066
1062
1067
1063
/** An erased value or an erased inline method or field */
Copy file name to clipboardExpand all lines: compiler/src/dotty/tools/dotc/typer/Typer.scala
+1-5Lines changed: 1 addition & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -4741,11 +4741,7 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
4741
4741
valinlined=Inlines.inlineCall(tree)
4742
4742
if ((inlined ne tree) && errorCount == ctx.reporter.errorCount) readaptSimplified(inlined)
4743
4743
else inlined
4744
-
elseif (tree.symbol.isScala2Macro &&
4745
-
// `raw`, `f` and `s` are eliminated by the StringInterpolatorOpt phase
4746
-
tree.symbol != defn.StringContext_raw&&
4747
-
tree.symbol != defn.StringContext_f&&
4748
-
tree.symbol != defn.StringContext_s)
4744
+
elseif (tree.symbol.isScala2Macro)
4749
4745
if (ctx.settings.XignoreScala2Macros.value) {
4750
4746
report.warning("Scala 2 macro cannot be used in Dotty, this call will crash at runtime. See https://docs.scala-lang.org/scala3/reference/dropped-features/macros.html", tree.srcPos.startPos)
4751
4747
Throw(New(defn.MatchErrorClass.typeRef, Literal(Constant(s"Reached unexpanded Scala 2 macro call to ${tree.symbol.showFullName} compiled with -Xignore-scala2-macros.")) ::Nil))
0 commit comments