Skip to content

Commit 046980f

Browse files
committed
Remove -Yscala2-experimental-compat
1 parent d407633 commit 046980f

File tree

6 files changed

+1
-20
lines changed

6 files changed

+1
-20
lines changed

compiler/src/dotty/tools/dotc/config/ScalaSettings.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,6 @@ class ScalaSettings extends Settings.SettingGroup {
168168
val YexplicitNulls: Setting[Boolean] = BooleanSetting("-Yexplicit-nulls", "Make reference types non-nullable. Nullable types can be expressed with unions: e.g. String|Null.")
169169
val YerasedTerms: Setting[Boolean] = BooleanSetting("-Yerased-terms", "Allows the use of erased terms.")
170170
val YcheckInit: Setting[Boolean] = BooleanSetting("-Ycheck-init", "Check initialization of objects")
171-
val YScala2ExperimentalCompat: Setting[Boolean] = BooleanSetting("-Yscala2-experimental-compat", "Allows Scala 2 macro definitions (no checks performed)")
172171

173172
/** Area-specific debug output */
174173
val YexplainLowlevel: Setting[Boolean] = BooleanSetting("-Yexplain-lowlevel", "When explaining type errors, show types at a lower level.")

compiler/src/dotty/tools/dotc/parsing/Parsers.scala

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2248,20 +2248,7 @@ object Parsers {
22482248
newExpr()
22492249
case MACRO =>
22502250
val start = in.skipToken()
2251-
val call = simpleExpr()
2252-
call match
2253-
case Ident(name) if name eq nme.??? =>
2254-
// The standard library uses "macro ???" to denote "fast track" macros
2255-
// hardcoded in the compiler, don't issue an error for those macros
2256-
// since we want to be able to compile the standard library.
2257-
MacroTree(call)
2258-
case _ if ctx.settings.YScala2ExperimentalCompat.value =>
2259-
MacroTree(call)
2260-
case _ =>
2261-
syntaxError(
2262-
"Scala 2 macros are not supported, see https://dotty.epfl.ch/docs/reference/dropped-features/macros.html",
2263-
start)
2264-
unimplementedExpr
2251+
MacroTree(simpleExpr())
22652252
case COLONEOL =>
22662253
syntaxError("':' not allowed here")
22672254
in.nextToken()

compiler/test/dotty/tools/dotc/CompilationTests.scala

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,6 @@ class CompilationTests extends ParallelTesting {
6565
compileFile("tests/pos-special/kind-projector.scala", defaultOptions.and("-Ykind-projector")),
6666
compileFile("tests/run/i5606.scala", defaultOptions.and("-Yretain-trees")),
6767
compileFile("tests/pos-custom-args/i5498-postfixOps.scala", defaultOptions withoutLanguageFeature "postfixOps"),
68-
compileFile("tests/pos-custom-args/scala2-macro-compat-1.scala", defaultOptions.and("-Yscala2-experimental-compat")),
69-
compileFile("tests/pos-custom-args/scala2-macro-compat-2.scala", defaultOptions.and("-Yscala2-experimental-compat")),
7068

7169
).checkCompile()
7270
}
@@ -141,7 +139,6 @@ class CompilationTests extends ParallelTesting {
141139
compileFile("tests/neg-custom-args/i3882.scala", allowDeepSubtypes),
142140
compileFile("tests/neg-custom-args/i4372.scala", allowDeepSubtypes),
143141
compileFile("tests/neg-custom-args/i1754.scala", allowDeepSubtypes),
144-
compileFile("tests/neg-custom-args/scala2-macro-compat-no-scala3-implementation.scala", defaultOptions.and("-Yscala2-experimental-compat")),
145142
compileFile("tests/neg-custom-args/interop-polytypes.scala", allowDeepSubtypes.and("-Yexplicit-nulls")),
146143
compileFile("tests/neg-custom-args/conditionalWarnings.scala", allowDeepSubtypes.and("-deprecation").and("-Xfatal-warnings")),
147144
compileFilesInDir("tests/neg-custom-args/isInstanceOf", allowDeepSubtypes and "-Xfatal-warnings"),

tests/neg-custom-args/scala2-macro-compat-no-scala3-implementation.scala renamed to tests/neg/scala2-macro-compat-no-scala3-implementation.scala

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
2-
31
object Macro1 {
42
import scala.language.experimental.macros
53
def lineNumber: Int = macro LineNumberMacro2.thisLineNumberImpl // error: No Scala 3 implementation found for this Scala 2 macro.

0 commit comments

Comments
 (0)