From 01dfd085cf7c60e4ea924f53de3067383efd63bd Mon Sep 17 00:00:00 2001 From: Nicolas Stucki Date: Fri, 16 Feb 2024 14:30:51 +0100 Subject: [PATCH] Do not enable experimental by default in nightly and snapshot versions This scheme was devised as a simple way to enable experimental on non-stable released. This made it impossible to publish a library containing experimental features for a non-experimental version of the compiler. We had `-Yno-experimental` to test the expected behavior on stable releases. Later we added `-experimental` which add `@experimental` to all top-level classes. On a stable release, this has the same effect as enabling experimental features, but it also allows publishing this library (users will need to also be experimental to use it). We can use `-experimental` on nightly and snapshot releases to achieve the same behavior as before. By doing this the `-Yno-experimental` flag is no longer needed and can be removed. We will need to use `-experimental` in all our tests to enable experimental by default. We can add this compiler flag to the default settings. We also need a few tests that do not use `-experimental` to test the behavior of `@experimental`. These can be added in `tests/*-no-experimental/`. Not all tests have `-experimental` enabled, this will be added on a need basis. With this we detected one bug, the runtime staging compile crashes if the code uses experimental features. To fix this we enable `-experimental` by default in this compiler. Note that the experimental-ness checks will have been done by the compiler that compiled the quotes. --- compiler/src/dotty/tools/dotc/config/Feature.scala | 5 ++--- .../src/dotty/tools/dotc/config/Properties.scala | 9 ++------- .../src/dotty/tools/dotc/config/ScalaSettings.scala | 1 - compiler/src/dotty/tools/dotc/plugins/Plugins.scala | 2 +- compiler/test/dotty/tools/DottyTest.scala | 1 + .../dotc/BootstrappedOnlyCompilationTests.scala | 13 +++++++++---- compiler/test/dotty/tools/repl/ReplTest.scala | 2 +- compiler/test/dotty/tools/repl/ScriptedTests.scala | 3 ++- .../test/dotty/tools/vulpix/TestConfiguration.scala | 2 +- .../other-new-features/experimental-defs.md | 2 -- .../other-new-features/experimental-defs.md | 7 ++----- project/Build.scala | 4 +--- staging/src/scala/quoted/staging/QuoteDriver.scala | 5 ++++- tests/neg-macros/i18677-a.check | 10 +++++----- tests/neg-macros/i18677-a/Macro_1.scala | 4 +--- tests/neg-macros/i18677-a/Test_2.scala | 4 +--- tests/neg-macros/i18677-b.check | 10 +++++----- tests/neg-macros/i18677-b/Macro_1.scala | 4 +--- tests/neg-macros/i18677-b/Test_2.scala | 4 +--- tests/{neg => neg-no-experimental}/14034.scala | 0 .../expeimental-flag-with-lang-feature-1.scala | 0 .../expeimental-flag-with-lang-feature-2.scala | 0 .../expeimental-flag.scala | 0 .../experimental-2.scala | 0 .../experimental-erased.scala | 0 .../experimental-imports.scala | 0 .../experimental-nested-imports-2.scala | 0 .../experimental-nested-imports-3.scala | 0 .../experimental-nested-imports.scala | 0 .../experimental-package-imports.scala | 0 .../{neg => neg-no-experimental}/experimental.scala | 0 .../experimentalAnnot.scala | 0 .../experimentalCaseClass.scala | 0 .../experimentalDefaultParams.scala | 0 .../experimentalEnum.scala | 0 .../experimentalErased.scala | 0 .../experimentalInline.scala | 0 .../experimentalInline2.scala | 0 .../experimentalMembers.scala | 0 .../experimentalOverloads.scala | 0 .../experimentalOverride.scala | 0 .../experimentalRHS.scala | 0 .../experimentalSam.scala | 0 .../experimentalSignature.scala | 0 .../experimentalTerms.scala | 0 .../experimentalTests.scala | 0 .../experimentalType.scala | 0 .../experimentalTypeRHS.scala | 0 .../experimentalTypes2.scala | 0 .../experimentalUnapply.scala | 0 tests/{neg => neg-no-experimental}/i13091.scala | 0 tests/{neg => neg-no-experimental}/i13848.scala | 0 tests/{neg => neg-no-experimental}/i17292.scala | 0 tests/{neg => neg-no-experimental}/i17292b.scala | 0 .../macro-experimental.scala | 0 .../cc-experimental.scala | 0 .../dotty-experimental.scala | 0 .../expeimental-flag-with-lang-feature.scala | 0 .../expeimental-flag.scala | 0 .../experimental-imports-empty.scala | 0 .../experimental-imports-top.scala | 0 tests/{pos => pos-no-experimental}/i13848.scala | 0 tests/{pos => pos-no-experimental}/i15133a.scala | 0 tests/{pos => pos-no-experimental}/i15133b.scala | 0 tests/{pos => pos-no-experimental}/i16091.scala | 0 tests/{pos => pos-no-experimental}/i8945.scala | 0 tests/run-macros/term-show.check | 2 +- 67 files changed, 41 insertions(+), 53 deletions(-) rename tests/{neg => neg-no-experimental}/14034.scala (100%) rename tests/{neg => neg-no-experimental}/expeimental-flag-with-lang-feature-1.scala (100%) rename tests/{neg => neg-no-experimental}/expeimental-flag-with-lang-feature-2.scala (100%) rename tests/{neg => neg-no-experimental}/expeimental-flag.scala (100%) rename tests/{neg => neg-no-experimental}/experimental-2.scala (100%) rename tests/{neg => neg-no-experimental}/experimental-erased.scala (100%) rename tests/{neg => neg-no-experimental}/experimental-imports.scala (100%) rename tests/{neg => neg-no-experimental}/experimental-nested-imports-2.scala (100%) rename tests/{neg => neg-no-experimental}/experimental-nested-imports-3.scala (100%) rename tests/{neg => neg-no-experimental}/experimental-nested-imports.scala (100%) rename tests/{neg => neg-no-experimental}/experimental-package-imports.scala (100%) rename tests/{neg => neg-no-experimental}/experimental.scala (100%) rename tests/{neg => neg-no-experimental}/experimentalAnnot.scala (100%) rename tests/{neg => neg-no-experimental}/experimentalCaseClass.scala (100%) rename tests/{neg => neg-no-experimental}/experimentalDefaultParams.scala (100%) rename tests/{neg => neg-no-experimental}/experimentalEnum.scala (100%) rename tests/{neg => neg-no-experimental}/experimentalErased.scala (100%) rename tests/{neg => neg-no-experimental}/experimentalInline.scala (100%) rename tests/{neg => neg-no-experimental}/experimentalInline2.scala (100%) rename tests/{neg => neg-no-experimental}/experimentalMembers.scala (100%) rename tests/{neg => neg-no-experimental}/experimentalOverloads.scala (100%) rename tests/{neg => neg-no-experimental}/experimentalOverride.scala (100%) rename tests/{neg => neg-no-experimental}/experimentalRHS.scala (100%) rename tests/{neg => neg-no-experimental}/experimentalSam.scala (100%) rename tests/{neg => neg-no-experimental}/experimentalSignature.scala (100%) rename tests/{neg => neg-no-experimental}/experimentalTerms.scala (100%) rename tests/{neg => neg-no-experimental}/experimentalTests.scala (100%) rename tests/{neg => neg-no-experimental}/experimentalType.scala (100%) rename tests/{neg => neg-no-experimental}/experimentalTypeRHS.scala (100%) rename tests/{neg => neg-no-experimental}/experimentalTypes2.scala (100%) rename tests/{neg => neg-no-experimental}/experimentalUnapply.scala (100%) rename tests/{neg => neg-no-experimental}/i13091.scala (100%) rename tests/{neg => neg-no-experimental}/i13848.scala (100%) rename tests/{neg => neg-no-experimental}/i17292.scala (100%) rename tests/{neg => neg-no-experimental}/i17292b.scala (100%) rename tests/{neg-macros => neg-no-experimental}/macro-experimental.scala (100%) rename tests/{pos => pos-no-experimental}/cc-experimental.scala (100%) rename tests/{pos => pos-no-experimental}/dotty-experimental.scala (100%) rename tests/{pos => pos-no-experimental}/expeimental-flag-with-lang-feature.scala (100%) rename tests/{pos => pos-no-experimental}/expeimental-flag.scala (100%) rename tests/{pos => pos-no-experimental}/experimental-imports-empty.scala (100%) rename tests/{pos => pos-no-experimental}/experimental-imports-top.scala (100%) rename tests/{pos => pos-no-experimental}/i13848.scala (100%) rename tests/{pos => pos-no-experimental}/i15133a.scala (100%) rename tests/{pos => pos-no-experimental}/i15133b.scala (100%) rename tests/{pos => pos-no-experimental}/i16091.scala (100%) rename tests/{pos => pos-no-experimental}/i8945.scala (100%) diff --git a/compiler/src/dotty/tools/dotc/config/Feature.scala b/compiler/src/dotty/tools/dotc/config/Feature.scala index 2798828ad9a7..cf53448b9640 100644 --- a/compiler/src/dotty/tools/dotc/config/Feature.scala +++ b/compiler/src/dotty/tools/dotc/config/Feature.scala @@ -136,8 +136,7 @@ object Feature: report.error( em"""Experimental $which may only be used under experimental mode: | 1. In a definition marked as @experimental - | 2. Compiling with the -experimental compiler flag - | 3. With a nightly or snapshot version of the compiler$note + | 2. Compiling with the -experimental compiler flag$note """, srcPos) private def ccException(sym: Symbol)(using Context): Boolean = @@ -163,7 +162,7 @@ object Feature: do checkExperimentalFeature(s"feature $setting", NoSourcePosition) def isExperimentalEnabled(using Context): Boolean = - (Properties.experimental || ctx.settings.experimental.value) && !ctx.settings.YnoExperimental.value + ctx.settings.experimental.value /** Handle language import `import language..` if it is one * of the global imports `pureFunctions` or `captureChecking`. In this case diff --git a/compiler/src/dotty/tools/dotc/config/Properties.scala b/compiler/src/dotty/tools/dotc/config/Properties.scala index 1e9cc82112af..3ec52847de1c 100644 --- a/compiler/src/dotty/tools/dotc/config/Properties.scala +++ b/compiler/src/dotty/tools/dotc/config/Properties.scala @@ -84,13 +84,8 @@ trait PropertiesTrait { */ val versionString: String = "version " + simpleVersionString - /** Whether the current version of compiler is experimental - * - * 1. Snapshot, nightly releases and non-bootstrapped compiler are experimental. - * 2. Features supported by experimental versions of the compiler: - * - research plugins - */ - val experimental: Boolean = versionString.contains("SNAPSHOT") || versionString.contains("NIGHTLY") || versionString.contains("nonbootstrapped") + /** Whether the current version of supports research plugins */ + val researchPluginsEnabled: Boolean = versionString.contains("SNAPSHOT") || versionString.contains("NIGHTLY") || versionString.contains("nonbootstrapped") val copyrightString: String = scalaPropOrElse("copyright.string", "(c) 2002-2017 LAMP/EPFL") diff --git a/compiler/src/dotty/tools/dotc/config/ScalaSettings.scala b/compiler/src/dotty/tools/dotc/config/ScalaSettings.scala index 85e6ebef751f..db59bb9e3f65 100644 --- a/compiler/src/dotty/tools/dotc/config/ScalaSettings.scala +++ b/compiler/src/dotty/tools/dotc/config/ScalaSettings.scala @@ -397,7 +397,6 @@ private sealed trait YSettings: val YretainTrees: Setting[Boolean] = BooleanSetting("-Yretain-trees", "Retain trees for top-level classes, accessible from ClassSymbol#tree") val YshowTreeIds: Setting[Boolean] = BooleanSetting("-Yshow-tree-ids", "Uniquely tag all tree nodes in debugging output.") val YfromTastyIgnoreList: Setting[List[String]] = MultiStringSetting("-Yfrom-tasty-ignore-list", "file", "List of `tasty` files in jar files that will not be loaded when using -from-tasty.") - val YnoExperimental: Setting[Boolean] = BooleanSetting("-Yno-experimental", "Disable experimental language features.") val YlegacyLazyVals: Setting[Boolean] = BooleanSetting("-Ylegacy-lazy-vals", "Use legacy (pre 3.3.0) implementation of lazy vals.") val YcompileScala2Library: Setting[Boolean] = BooleanSetting("-Ycompile-scala2-library", "Used when compiling the Scala 2 standard library.") val YoutputOnlyTasty: Setting[Boolean] = BooleanSetting("-Youtput-only-tasty", "Used to only generate the TASTy file without the classfiles") diff --git a/compiler/src/dotty/tools/dotc/plugins/Plugins.scala b/compiler/src/dotty/tools/dotc/plugins/Plugins.scala index 05b9f0cf75d7..aaca2d12315e 100644 --- a/compiler/src/dotty/tools/dotc/plugins/Plugins.scala +++ b/compiler/src/dotty/tools/dotc/plugins/Plugins.scala @@ -129,7 +129,7 @@ trait Plugins { val updatedPlan = Plugins.schedule(plan, pluginPhases) // add research plugins - if Properties.experimental && !ctx.settings.YnoExperimental.value then + if Properties.researchPluginsEnabled then plugins.collect { case p: ResearchPlugin => p }.foldRight(updatedPlan) { (plug, plan) => plug.init(options(plug), plan) } diff --git a/compiler/test/dotty/tools/DottyTest.scala b/compiler/test/dotty/tools/DottyTest.scala index 7ccbc09a4c92..88d658e56fba 100644 --- a/compiler/test/dotty/tools/DottyTest.scala +++ b/compiler/test/dotty/tools/DottyTest.scala @@ -40,6 +40,7 @@ trait DottyTest extends ContextEscapeDetection { protected def initializeCtx(fc: FreshContext): Unit = { fc.setSetting(fc.settings.encoding, "UTF8") fc.setSetting(fc.settings.classpath, TestConfiguration.basicClasspath) + fc.setSetting(fc.settings.experimental, true) fc.setSetting(fc.settings.language, List("experimental.erasedDefinitions")) fc.setProperty(ContextDoc, new ContextDocstrings) } diff --git a/compiler/test/dotty/tools/dotc/BootstrappedOnlyCompilationTests.scala b/compiler/test/dotty/tools/dotc/BootstrappedOnlyCompilationTests.scala index ab2adddbb16e..91a9766e30fc 100644 --- a/compiler/test/dotty/tools/dotc/BootstrappedOnlyCompilationTests.scala +++ b/compiler/test/dotty/tools/dotc/BootstrappedOnlyCompilationTests.scala @@ -29,6 +29,7 @@ class BootstrappedOnlyCompilationTests { aggregateTests( compileFilesInDir("tests/bench", defaultOptions.without("-Yno-deep-subtypes")), compileFilesInDir("tests/pos-macros", defaultOptions.and("-Xcheck-macros")), + compileFilesInDir("tests/pos-no-experimental", defaultOptions.without("-experimental")), ).checkCompile() } @@ -104,8 +105,10 @@ class BootstrappedOnlyCompilationTests { @Test def negMacros: Unit = { implicit val testGroup: TestGroup = TestGroup("compileNegWithCompiler") - compileFilesInDir("tests/neg-macros", defaultOptions.and("-Xcheck-macros")) - .checkExpectedErrors() + aggregateTests( + compileFilesInDir("tests/neg-macros", defaultOptions.and("-Xcheck-macros")), + compileFilesInDir("tests/neg-no-experimental", defaultOptions.without("-experimental")), + ).checkExpectedErrors() } @Test def negWithCompiler: Unit = { @@ -120,8 +123,10 @@ class BootstrappedOnlyCompilationTests { @Test def runMacros: Unit = { implicit val testGroup: TestGroup = TestGroup("runMacros") - compileFilesInDir("tests/run-macros", defaultOptions.and("-Xcheck-macros"), FileFilter.exclude(TestSources.runMacrosScala2LibraryTastyBlacklisted)) - .checkRuns() + aggregateTests( + compileFilesInDir("tests/run-macros", defaultOptions.and("-Xcheck-macros"), FileFilter.exclude(TestSources.runMacrosScala2LibraryTastyBlacklisted)), + compileFilesInDir("tests/run-no-experimental", defaultOptions.without("-experimental")), + ).checkRuns() } @Test def runWithCompiler: Unit = { diff --git a/compiler/test/dotty/tools/repl/ReplTest.scala b/compiler/test/dotty/tools/repl/ReplTest.scala index 8fbf635c9a17..ae0d0c666a9c 100644 --- a/compiler/test/dotty/tools/repl/ReplTest.scala +++ b/compiler/test/dotty/tools/repl/ReplTest.scala @@ -104,6 +104,6 @@ extends ReplDriver(options, new PrintStream(out, true, StandardCharsets.UTF_8.na } object ReplTest: - val commonOptions = Array("-color:never", "-language:experimental.erasedDefinitions", "-pagewidth", "80") + val commonOptions = Array("-color:never", "-pagewidth", "80") val defaultOptions = commonOptions ++ Array("-classpath", TestConfiguration.basicClasspath) lazy val withStagingOptions = commonOptions ++ Array("-classpath", TestConfiguration.withStagingClasspath) diff --git a/compiler/test/dotty/tools/repl/ScriptedTests.scala b/compiler/test/dotty/tools/repl/ScriptedTests.scala index dc809228e86b..fce3ffad6814 100644 --- a/compiler/test/dotty/tools/repl/ScriptedTests.scala +++ b/compiler/test/dotty/tools/repl/ScriptedTests.scala @@ -6,7 +6,7 @@ import org.junit.Test import org.junit.experimental.categories.Category /** Runs all tests contained in `compiler/test-resources/repl/` */ -class ScriptedTests extends ReplTest { +class ScriptedTests extends ReplTest(ScriptedTests.options) { @Test def replTests = scripts("/repl").foreach(testFile) @@ -17,4 +17,5 @@ class ScriptedTests extends ReplTest { } object ScriptedTests { + val options = Array("-experimental", "-language:experimental.erasedDefinitions") ++ ReplTest.defaultOptions } diff --git a/compiler/test/dotty/tools/vulpix/TestConfiguration.scala b/compiler/test/dotty/tools/vulpix/TestConfiguration.scala index 04be00fe921e..5b80719936e3 100644 --- a/compiler/test/dotty/tools/vulpix/TestConfiguration.scala +++ b/compiler/test/dotty/tools/vulpix/TestConfiguration.scala @@ -65,7 +65,7 @@ object TestConfiguration { val yCheckOptions = Array("-Ycheck:all") - val commonOptions = Array("-indent") ++ checkOptions ++ noCheckOptions ++ yCheckOptions + val commonOptions = Array("-indent", "-experimental") ++ checkOptions ++ noCheckOptions ++ yCheckOptions val defaultOptions = TestFlags(basicClasspath, commonOptions) val unindentOptions = TestFlags(basicClasspath, Array("-no-indent") ++ checkOptions ++ noCheckOptions ++ yCheckOptions) val withCompilerOptions = diff --git a/docs/_docs/reference/other-new-features/experimental-defs.md b/docs/_docs/reference/other-new-features/experimental-defs.md index b71b20ecc036..e04e724cc1b3 100644 --- a/docs/_docs/reference/other-new-features/experimental-defs.md +++ b/docs/_docs/reference/other-new-features/experimental-defs.md @@ -265,8 +265,6 @@ Experimental definitions can only be referenced in an experimental scope. Experi -6. Any code compiled using a [_Nightly_](https://search.maven.org/artifact/org.scala-lang/scala3-compiler_3) or _Snapshot_ version of the compiler is considered to be in an experimental scope. -Can use the `-Yno-experimental` compiler flag to disable it and run as a proper release. In any other situation, a reference to an experimental definition will cause a compilation error. diff --git a/docs/_spec/TODOreference/other-new-features/experimental-defs.md b/docs/_spec/TODOreference/other-new-features/experimental-defs.md index 225b61161652..20fb935822cb 100644 --- a/docs/_spec/TODOreference/other-new-features/experimental-defs.md +++ b/docs/_spec/TODOreference/other-new-features/experimental-defs.md @@ -216,7 +216,7 @@ Experimental definitions can only be referenced in an experimental scope. Experi
Example 1 - + ```scala import scala.annotation.experimental @@ -242,7 +242,7 @@ Experimental definitions can only be referenced in an experimental scope. Experi } } ``` - +
5. Annotations of an experimental definition are in experimental scopes. Examples: @@ -265,9 +265,6 @@ Experimental definitions can only be referenced in an experimental scope. Experi -6. Any code compiled using a [_Nightly_](https://search.maven.org/artifact/org.scala-lang/scala3-compiler_3) or _Snapshot_ version of the compiler is considered to be in an experimental scope. -Can use the `-Yno-experimental` compiler flag to disable it and run as a proper release. - In any other situation, a reference to an experimental definition will cause a compilation error. ## Experimental inheritance diff --git a/project/Build.scala b/project/Build.scala index 356d8bd0e7b9..3163f11f75b6 100644 --- a/project/Build.scala +++ b/project/Build.scala @@ -1758,6 +1758,7 @@ object Build { SourceLinksIntegrationTest / test:= ((SourceLinksIntegrationTest / test) dependsOn generateScalaDocumentation.toTask("")).value, ). settings( + scalacOptions += "-experimental", Compile / resourceGenerators ++= Seq( generateStaticAssetsTask.taskValue, bundleCSS.taskValue @@ -2155,9 +2156,6 @@ object Build { settings( versionScheme := Some("semver-spec"), libraryDependencies += "org.scala-lang" % "scala-library" % stdlibVersion, - // Make sure we do not refer to experimental features outside an experimental scope. - // In other words, disable NIGHTLY/SNAPSHOT experimental scope. - scalacOptions += "-Yno-experimental", ). settings(dottyLibrarySettings) if (mode == Bootstrapped) { diff --git a/staging/src/scala/quoted/staging/QuoteDriver.scala b/staging/src/scala/quoted/staging/QuoteDriver.scala index e894a7bc40f2..81512960a166 100644 --- a/staging/src/scala/quoted/staging/QuoteDriver.scala +++ b/staging/src/scala/quoted/staging/QuoteDriver.scala @@ -37,7 +37,10 @@ private class QuoteDriver(appClassloader: ClassLoader) extends Driver: val ctx = { val ctx0 = QuotesCache.init(initCtx.fresh) val ctx1 = setup(settings.compilerArgs.toArray :+ "dummy.scala", ctx0).get._2 - setCompilerSettings(ctx1.fresh.setSetting(ctx1.settings.outputDir, outDir), settings) + val ctx2 = ctx1.fresh + ctx2.setSetting(ctx1.settings.outputDir, outDir) + ctx2.setSetting(ctx1.settings.experimental, true) + setCompilerSettings(ctx2, settings) } new QuoteCompiler().newRun(ctx).compileExpr(exprBuilder) match diff --git a/tests/neg-macros/i18677-a.check b/tests/neg-macros/i18677-a.check index 976ff7bddda2..4afea440aedb 100644 --- a/tests/neg-macros/i18677-a.check +++ b/tests/neg-macros/i18677-a.check @@ -1,16 +1,16 @@ --- Error: tests/neg-macros/i18677-a/Test_2.scala:4:6 ------------------------------------------------------------------- -3 |@extendFoo -4 |class AFoo // error +-- Error: tests/neg-macros/i18677-a/Test_2.scala:2:6 ------------------------------------------------------------------- +1 |@extendFoo +2 |class AFoo // error |^ |Malformed tree was found while expanding macro with -Xcheck-macros. |The tree does not conform to the compiler's tree invariants. | |Macro was: - |@scala.annotation.internal.SourceFile("tests/neg-macros/i18677-a/Test_2.scala") @extendFoo class AFoo() + |@scala.annotation.internal.SourceFile("tests/neg-macros/i18677-a/Test_2.scala") @scala.annotation.experimental @extendFoo class AFoo() | |The macro returned: - |@scala.annotation.internal.SourceFile("tests/neg-macros/i18677-a/Test_2.scala") @extendFoo class AFoo() extends Foo + |@scala.annotation.internal.SourceFile("tests/neg-macros/i18677-a/Test_2.scala") @scala.annotation.experimental @extendFoo class AFoo() extends Foo | |Error: |assertion failed: Parents of class symbol differs from the parents in the tree for class AFoo diff --git a/tests/neg-macros/i18677-a/Macro_1.scala b/tests/neg-macros/i18677-a/Macro_1.scala index f624d2d15782..bf7b817a91f5 100644 --- a/tests/neg-macros/i18677-a/Macro_1.scala +++ b/tests/neg-macros/i18677-a/Macro_1.scala @@ -1,5 +1,3 @@ -//> using -expermiental - import annotation.MacroAnnotation import quoted.* @@ -15,4 +13,4 @@ class extendFoo extends MacroAnnotation : newTree :: Nil case _ => report.error("@extendFoo can only annotate class definitions") - tree :: Nil \ No newline at end of file + tree :: Nil diff --git a/tests/neg-macros/i18677-a/Test_2.scala b/tests/neg-macros/i18677-a/Test_2.scala index 486d7e09a4bc..2507a8696aff 100644 --- a/tests/neg-macros/i18677-a/Test_2.scala +++ b/tests/neg-macros/i18677-a/Test_2.scala @@ -1,4 +1,2 @@ -//> using -expermiental - @extendFoo -class AFoo // error \ No newline at end of file +class AFoo // error diff --git a/tests/neg-macros/i18677-b.check b/tests/neg-macros/i18677-b.check index b6d817a53706..2b80d954d4d0 100644 --- a/tests/neg-macros/i18677-b.check +++ b/tests/neg-macros/i18677-b.check @@ -1,16 +1,16 @@ --- Error: tests/neg-macros/i18677-b/Test_2.scala:4:6 ------------------------------------------------------------------- -3 |@extendFoo -4 |class AFoo // error +-- Error: tests/neg-macros/i18677-b/Test_2.scala:2:6 ------------------------------------------------------------------- +1 |@extendFoo +2 |class AFoo // error |^ |Malformed tree was found while expanding macro with -Xcheck-macros. |The tree does not conform to the compiler's tree invariants. | |Macro was: - |@scala.annotation.internal.SourceFile("tests/neg-macros/i18677-b/Test_2.scala") @extendFoo class AFoo() + |@scala.annotation.internal.SourceFile("tests/neg-macros/i18677-b/Test_2.scala") @scala.annotation.experimental @extendFoo class AFoo() | |The macro returned: - |@scala.annotation.internal.SourceFile("tests/neg-macros/i18677-b/Test_2.scala") @extendFoo class AFoo() extends Foo + |@scala.annotation.internal.SourceFile("tests/neg-macros/i18677-b/Test_2.scala") @scala.annotation.experimental @extendFoo class AFoo() extends Foo | |Error: |assertion failed: Parents of class symbol differs from the parents in the tree for class AFoo diff --git a/tests/neg-macros/i18677-b/Macro_1.scala b/tests/neg-macros/i18677-b/Macro_1.scala index b2ff946ad302..09707a9d4548 100644 --- a/tests/neg-macros/i18677-b/Macro_1.scala +++ b/tests/neg-macros/i18677-b/Macro_1.scala @@ -1,5 +1,3 @@ -//> using -expermiental - import annotation.MacroAnnotation import quoted.* @@ -15,4 +13,4 @@ class extendFoo extends MacroAnnotation : newTree :: Nil case _ => report.error("@extendFoo can only annotate class definitions") - tree :: Nil \ No newline at end of file + tree :: Nil diff --git a/tests/neg-macros/i18677-b/Test_2.scala b/tests/neg-macros/i18677-b/Test_2.scala index 486d7e09a4bc..2507a8696aff 100644 --- a/tests/neg-macros/i18677-b/Test_2.scala +++ b/tests/neg-macros/i18677-b/Test_2.scala @@ -1,4 +1,2 @@ -//> using -expermiental - @extendFoo -class AFoo // error \ No newline at end of file +class AFoo // error diff --git a/tests/neg/14034.scala b/tests/neg-no-experimental/14034.scala similarity index 100% rename from tests/neg/14034.scala rename to tests/neg-no-experimental/14034.scala diff --git a/tests/neg/expeimental-flag-with-lang-feature-1.scala b/tests/neg-no-experimental/expeimental-flag-with-lang-feature-1.scala similarity index 100% rename from tests/neg/expeimental-flag-with-lang-feature-1.scala rename to tests/neg-no-experimental/expeimental-flag-with-lang-feature-1.scala diff --git a/tests/neg/expeimental-flag-with-lang-feature-2.scala b/tests/neg-no-experimental/expeimental-flag-with-lang-feature-2.scala similarity index 100% rename from tests/neg/expeimental-flag-with-lang-feature-2.scala rename to tests/neg-no-experimental/expeimental-flag-with-lang-feature-2.scala diff --git a/tests/neg/expeimental-flag.scala b/tests/neg-no-experimental/expeimental-flag.scala similarity index 100% rename from tests/neg/expeimental-flag.scala rename to tests/neg-no-experimental/expeimental-flag.scala diff --git a/tests/neg/experimental-2.scala b/tests/neg-no-experimental/experimental-2.scala similarity index 100% rename from tests/neg/experimental-2.scala rename to tests/neg-no-experimental/experimental-2.scala diff --git a/tests/neg/experimental-erased.scala b/tests/neg-no-experimental/experimental-erased.scala similarity index 100% rename from tests/neg/experimental-erased.scala rename to tests/neg-no-experimental/experimental-erased.scala diff --git a/tests/neg/experimental-imports.scala b/tests/neg-no-experimental/experimental-imports.scala similarity index 100% rename from tests/neg/experimental-imports.scala rename to tests/neg-no-experimental/experimental-imports.scala diff --git a/tests/neg/experimental-nested-imports-2.scala b/tests/neg-no-experimental/experimental-nested-imports-2.scala similarity index 100% rename from tests/neg/experimental-nested-imports-2.scala rename to tests/neg-no-experimental/experimental-nested-imports-2.scala diff --git a/tests/neg/experimental-nested-imports-3.scala b/tests/neg-no-experimental/experimental-nested-imports-3.scala similarity index 100% rename from tests/neg/experimental-nested-imports-3.scala rename to tests/neg-no-experimental/experimental-nested-imports-3.scala diff --git a/tests/neg/experimental-nested-imports.scala b/tests/neg-no-experimental/experimental-nested-imports.scala similarity index 100% rename from tests/neg/experimental-nested-imports.scala rename to tests/neg-no-experimental/experimental-nested-imports.scala diff --git a/tests/neg/experimental-package-imports.scala b/tests/neg-no-experimental/experimental-package-imports.scala similarity index 100% rename from tests/neg/experimental-package-imports.scala rename to tests/neg-no-experimental/experimental-package-imports.scala diff --git a/tests/neg/experimental.scala b/tests/neg-no-experimental/experimental.scala similarity index 100% rename from tests/neg/experimental.scala rename to tests/neg-no-experimental/experimental.scala diff --git a/tests/neg/experimentalAnnot.scala b/tests/neg-no-experimental/experimentalAnnot.scala similarity index 100% rename from tests/neg/experimentalAnnot.scala rename to tests/neg-no-experimental/experimentalAnnot.scala diff --git a/tests/neg/experimentalCaseClass.scala b/tests/neg-no-experimental/experimentalCaseClass.scala similarity index 100% rename from tests/neg/experimentalCaseClass.scala rename to tests/neg-no-experimental/experimentalCaseClass.scala diff --git a/tests/neg/experimentalDefaultParams.scala b/tests/neg-no-experimental/experimentalDefaultParams.scala similarity index 100% rename from tests/neg/experimentalDefaultParams.scala rename to tests/neg-no-experimental/experimentalDefaultParams.scala diff --git a/tests/neg/experimentalEnum.scala b/tests/neg-no-experimental/experimentalEnum.scala similarity index 100% rename from tests/neg/experimentalEnum.scala rename to tests/neg-no-experimental/experimentalEnum.scala diff --git a/tests/neg/experimentalErased.scala b/tests/neg-no-experimental/experimentalErased.scala similarity index 100% rename from tests/neg/experimentalErased.scala rename to tests/neg-no-experimental/experimentalErased.scala diff --git a/tests/neg/experimentalInline.scala b/tests/neg-no-experimental/experimentalInline.scala similarity index 100% rename from tests/neg/experimentalInline.scala rename to tests/neg-no-experimental/experimentalInline.scala diff --git a/tests/neg/experimentalInline2.scala b/tests/neg-no-experimental/experimentalInline2.scala similarity index 100% rename from tests/neg/experimentalInline2.scala rename to tests/neg-no-experimental/experimentalInline2.scala diff --git a/tests/neg/experimentalMembers.scala b/tests/neg-no-experimental/experimentalMembers.scala similarity index 100% rename from tests/neg/experimentalMembers.scala rename to tests/neg-no-experimental/experimentalMembers.scala diff --git a/tests/neg/experimentalOverloads.scala b/tests/neg-no-experimental/experimentalOverloads.scala similarity index 100% rename from tests/neg/experimentalOverloads.scala rename to tests/neg-no-experimental/experimentalOverloads.scala diff --git a/tests/neg/experimentalOverride.scala b/tests/neg-no-experimental/experimentalOverride.scala similarity index 100% rename from tests/neg/experimentalOverride.scala rename to tests/neg-no-experimental/experimentalOverride.scala diff --git a/tests/neg/experimentalRHS.scala b/tests/neg-no-experimental/experimentalRHS.scala similarity index 100% rename from tests/neg/experimentalRHS.scala rename to tests/neg-no-experimental/experimentalRHS.scala diff --git a/tests/neg/experimentalSam.scala b/tests/neg-no-experimental/experimentalSam.scala similarity index 100% rename from tests/neg/experimentalSam.scala rename to tests/neg-no-experimental/experimentalSam.scala diff --git a/tests/neg/experimentalSignature.scala b/tests/neg-no-experimental/experimentalSignature.scala similarity index 100% rename from tests/neg/experimentalSignature.scala rename to tests/neg-no-experimental/experimentalSignature.scala diff --git a/tests/neg/experimentalTerms.scala b/tests/neg-no-experimental/experimentalTerms.scala similarity index 100% rename from tests/neg/experimentalTerms.scala rename to tests/neg-no-experimental/experimentalTerms.scala diff --git a/tests/neg/experimentalTests.scala b/tests/neg-no-experimental/experimentalTests.scala similarity index 100% rename from tests/neg/experimentalTests.scala rename to tests/neg-no-experimental/experimentalTests.scala diff --git a/tests/neg/experimentalType.scala b/tests/neg-no-experimental/experimentalType.scala similarity index 100% rename from tests/neg/experimentalType.scala rename to tests/neg-no-experimental/experimentalType.scala diff --git a/tests/neg/experimentalTypeRHS.scala b/tests/neg-no-experimental/experimentalTypeRHS.scala similarity index 100% rename from tests/neg/experimentalTypeRHS.scala rename to tests/neg-no-experimental/experimentalTypeRHS.scala diff --git a/tests/neg/experimentalTypes2.scala b/tests/neg-no-experimental/experimentalTypes2.scala similarity index 100% rename from tests/neg/experimentalTypes2.scala rename to tests/neg-no-experimental/experimentalTypes2.scala diff --git a/tests/neg/experimentalUnapply.scala b/tests/neg-no-experimental/experimentalUnapply.scala similarity index 100% rename from tests/neg/experimentalUnapply.scala rename to tests/neg-no-experimental/experimentalUnapply.scala diff --git a/tests/neg/i13091.scala b/tests/neg-no-experimental/i13091.scala similarity index 100% rename from tests/neg/i13091.scala rename to tests/neg-no-experimental/i13091.scala diff --git a/tests/neg/i13848.scala b/tests/neg-no-experimental/i13848.scala similarity index 100% rename from tests/neg/i13848.scala rename to tests/neg-no-experimental/i13848.scala diff --git a/tests/neg/i17292.scala b/tests/neg-no-experimental/i17292.scala similarity index 100% rename from tests/neg/i17292.scala rename to tests/neg-no-experimental/i17292.scala diff --git a/tests/neg/i17292b.scala b/tests/neg-no-experimental/i17292b.scala similarity index 100% rename from tests/neg/i17292b.scala rename to tests/neg-no-experimental/i17292b.scala diff --git a/tests/neg-macros/macro-experimental.scala b/tests/neg-no-experimental/macro-experimental.scala similarity index 100% rename from tests/neg-macros/macro-experimental.scala rename to tests/neg-no-experimental/macro-experimental.scala diff --git a/tests/pos/cc-experimental.scala b/tests/pos-no-experimental/cc-experimental.scala similarity index 100% rename from tests/pos/cc-experimental.scala rename to tests/pos-no-experimental/cc-experimental.scala diff --git a/tests/pos/dotty-experimental.scala b/tests/pos-no-experimental/dotty-experimental.scala similarity index 100% rename from tests/pos/dotty-experimental.scala rename to tests/pos-no-experimental/dotty-experimental.scala diff --git a/tests/pos/expeimental-flag-with-lang-feature.scala b/tests/pos-no-experimental/expeimental-flag-with-lang-feature.scala similarity index 100% rename from tests/pos/expeimental-flag-with-lang-feature.scala rename to tests/pos-no-experimental/expeimental-flag-with-lang-feature.scala diff --git a/tests/pos/expeimental-flag.scala b/tests/pos-no-experimental/expeimental-flag.scala similarity index 100% rename from tests/pos/expeimental-flag.scala rename to tests/pos-no-experimental/expeimental-flag.scala diff --git a/tests/pos/experimental-imports-empty.scala b/tests/pos-no-experimental/experimental-imports-empty.scala similarity index 100% rename from tests/pos/experimental-imports-empty.scala rename to tests/pos-no-experimental/experimental-imports-empty.scala diff --git a/tests/pos/experimental-imports-top.scala b/tests/pos-no-experimental/experimental-imports-top.scala similarity index 100% rename from tests/pos/experimental-imports-top.scala rename to tests/pos-no-experimental/experimental-imports-top.scala diff --git a/tests/pos/i13848.scala b/tests/pos-no-experimental/i13848.scala similarity index 100% rename from tests/pos/i13848.scala rename to tests/pos-no-experimental/i13848.scala diff --git a/tests/pos/i15133a.scala b/tests/pos-no-experimental/i15133a.scala similarity index 100% rename from tests/pos/i15133a.scala rename to tests/pos-no-experimental/i15133a.scala diff --git a/tests/pos/i15133b.scala b/tests/pos-no-experimental/i15133b.scala similarity index 100% rename from tests/pos/i15133b.scala rename to tests/pos-no-experimental/i15133b.scala diff --git a/tests/pos/i16091.scala b/tests/pos-no-experimental/i16091.scala similarity index 100% rename from tests/pos/i16091.scala rename to tests/pos-no-experimental/i16091.scala diff --git a/tests/pos/i8945.scala b/tests/pos-no-experimental/i8945.scala similarity index 100% rename from tests/pos/i8945.scala rename to tests/pos-no-experimental/i8945.scala diff --git a/tests/run-macros/term-show.check b/tests/run-macros/term-show.check index 91ba0308e3db..a4de9d15db3a 100644 --- a/tests/run-macros/term-show.check +++ b/tests/run-macros/term-show.check @@ -10,7 +10,7 @@ } () } -@scala.annotation.internal.SourceFile("tests/run-macros/term-show/Test_2.scala") trait A() extends java.lang.Object { +@scala.annotation.internal.SourceFile("tests/run-macros/term-show/Test_2.scala") @scala.annotation.experimental trait A() extends java.lang.Object { def imp(x: scala.Int)(implicit str: scala.Predef.String): scala.Int def use(`x₂`: scala.Int)(using `str₂`: scala.Predef.String): scala.Int def era(`x₃`: scala.Int)(erased `str₃`: scala.Predef.String): scala.Int