diff --git a/compiler/src/dotty/tools/dotc/config/Feature.scala b/compiler/src/dotty/tools/dotc/config/Feature.scala index 5bcc139326f9..0fc447d90316 100644 --- a/compiler/src/dotty/tools/dotc/config/Feature.scala +++ b/compiler/src/dotty/tools/dotc/config/Feature.scala @@ -134,7 +134,11 @@ object Feature: def checkExperimentalFeature(which: String, srcPos: SrcPos, note: => String = "")(using Context) = if !isExperimentalEnabled then - report.error(em"Experimental $which may only be used with a nightly or snapshot version of the compiler$note", srcPos) + report.error( + em"""$which may only be used under experimental mode: + | 1. In a definition marked as @experimental + | 2. Compiling with the -experimental compiler flag$note + """, srcPos) private def ccException(sym: Symbol)(using Context): Boolean = ccEnabled && defn.ccExperimental.contains(sym) @@ -148,18 +152,18 @@ object Feature: if !ccException(experimentalSym) then val symMsg = if experimentalSym.exists - then i"$experimentalSym is marked @experimental" - else i"$sym inherits @experimental" - report.error(em"$symMsg and therefore may only be used in an experimental scope.", srcPos) + then i"$experimentalSym is marked @experimental, it" + else i"$sym inherits @experimental, it" + checkExperimentalFeature(symMsg, srcPos) - /** Check that experimental compiler options are only set for snapshot or nightly compiler versions. */ + /** Check that experimental compiler options are only set with `-experimental`. */ def checkExperimentalSettings(using Context): Unit = for setting <- ctx.settings.language.value if setting.startsWith("experimental.") && setting != "experimental.macros" - do checkExperimentalFeature(s"feature $setting", NoSourcePosition) + do checkExperimentalFeature(s"Experimental feature $setting", NoSourcePosition) def isExperimentalEnabled(using Context): Boolean = - Properties.experimental && !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..c5858aa4ea32 100644 --- a/compiler/src/dotty/tools/dotc/config/Properties.scala +++ b/compiler/src/dotty/tools/dotc/config/Properties.scala @@ -84,14 +84,6 @@ 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") - val copyrightString: String = scalaPropOrElse("copyright.string", "(c) 2002-2017 LAMP/EPFL") /** This is the encoding to use reading in source files, overridden with -encoding diff --git a/compiler/src/dotty/tools/dotc/config/ScalaSettings.scala b/compiler/src/dotty/tools/dotc/config/ScalaSettings.scala index 3dbfbfc6bab9..9eccf2332e17 100644 --- a/compiler/src/dotty/tools/dotc/config/ScalaSettings.scala +++ b/compiler/src/dotty/tools/dotc/config/ScalaSettings.scala @@ -119,6 +119,7 @@ trait CommonScalaSettings: val explainTypes: Setting[Boolean] = BooleanSetting("-explain-types", "Explain type errors in more detail (deprecated, use -explain instead).", aliases = List("--explain-types", "-explaintypes")) val unchecked: Setting[Boolean] = BooleanSetting("-unchecked", "Enable additional warnings where generated code depends on assumptions.", initialValue = true, aliases = List("--unchecked")) val language: Setting[List[String]] = MultiStringSetting("-language", "feature", "Enable one or more language features.", aliases = List("--language")) + val experimental: Setting[Boolean] = BooleanSetting("-experimental", "Annotate all top-level definitions with @experimental. This enables the use of experimental features anywhere in the project.") /* Coverage settings */ val coverageOutputDir = PathSetting("-coverage-out", "Destination for coverage classfiles and instrumentation data.", "", aliases = List("--coverage-out")) @@ -367,7 +368,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 Yscala2Stdlib: Setting[Boolean] = BooleanSetting("-Yscala2-stdlib", "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/transform/PostTyper.scala b/compiler/src/dotty/tools/dotc/transform/PostTyper.scala index 964486632979..5df7b5d4ea27 100644 --- a/compiler/src/dotty/tools/dotc/transform/PostTyper.scala +++ b/compiler/src/dotty/tools/dotc/transform/PostTyper.scala @@ -379,6 +379,7 @@ class PostTyper extends MacroTransform with InfoTransformer { thisPhase => ) } case tree: ValDef => + annotateExperimental(tree.symbol) registerIfHasMacroAnnotations(tree) checkErasedDef(tree) val tree1 = cpy.ValDef(tree)(rhs = normalizeErasedRhs(tree.rhs, tree.symbol)) @@ -386,6 +387,7 @@ class PostTyper extends MacroTransform with InfoTransformer { thisPhase => checkStableSelection(tree.rhs) processValOrDefDef(super.transform(tree1)) case tree: DefDef => + annotateExperimental(tree.symbol) registerIfHasMacroAnnotations(tree) checkErasedDef(tree) annotateContextResults(tree) @@ -537,9 +539,14 @@ class PostTyper extends MacroTransform with InfoTransformer { thisPhase => report.error("`erased` definition cannot be implemented with en expression of type Null", tree.srcPos) private def annotateExperimental(sym: Symbol)(using Context): Unit = - if sym.is(Module) && sym.companionClass.hasAnnotation(defn.ExperimentalAnnot) then + def isTopLevelDefinitionInSource(sym: Symbol) = + !sym.is(Package) && !sym.name.isPackageObjectName && + (sym.owner.is(Package) || (sym.owner.name.isPackageObjectName && !sym.isConstructor)) + if !sym.hasAnnotation(defn.ExperimentalAnnot) + && (ctx.settings.experimental.value && isTopLevelDefinitionInSource(sym)) + || (sym.is(Module) && sym.companionClass.hasAnnotation(defn.ExperimentalAnnot)) + then sym.addAnnotation(Annotation(defn.ExperimentalAnnot, sym.span)) - sym.companionModule.addAnnotation(Annotation(defn.ExperimentalAnnot, sym.span)) private def scala2LibPatch(tree: TypeDef)(using Context) = val sym = tree.symbol diff --git a/compiler/src/dotty/tools/dotc/typer/Checking.scala b/compiler/src/dotty/tools/dotc/typer/Checking.scala index 1ea24187a185..4839aaafa2de 100644 --- a/compiler/src/dotty/tools/dotc/typer/Checking.scala +++ b/compiler/src/dotty/tools/dotc/typer/Checking.scala @@ -805,7 +805,7 @@ object Checking { case Some(nme.experimental) if !ctx.owner.isInExperimentalScope && !selectors.forall(isAllowedImport) => def check(stable: => String) = - Feature.checkExperimentalFeature("features", imp.srcPos, + Feature.checkExperimentalFeature("Experimental features", imp.srcPos, s"\n\nNote: the scope enclosing the import is not considered experimental because it contains the\nnon-experimental $stable") if ctx.owner.is(Package) then // allow top-level experimental imports if all definitions are @experimental @@ -813,7 +813,7 @@ object Checking { case EmptyTree => case tree: MemberDef => check(i"${tree.symbol}") case tree => check(i"expression ${tree}") - else Feature.checkExperimentalFeature("features", imp.srcPos) + else Feature.checkExperimentalFeature("Experimental features", imp.srcPos) case _ => end checkExperimentalImports } diff --git a/compiler/src/dotty/tools/dotc/typer/QuotesAndSplices.scala b/compiler/src/dotty/tools/dotc/typer/QuotesAndSplices.scala index 28afccd1ca43..062da92be1ab 100644 --- a/compiler/src/dotty/tools/dotc/typer/QuotesAndSplices.scala +++ b/compiler/src/dotty/tools/dotc/typer/QuotesAndSplices.scala @@ -173,7 +173,7 @@ trait QuotesAndSplices { getQuotedPatternTypeVariable(tree.name.asTypeName) match case Some(typeSym) => checkExperimentalFeature( - "support for multiple references to the same type (without backticks) in quoted type patterns (SIP-53)", + "Experimental support for multiple references to the same type (without backticks) in quoted type patterns (SIP-53)", tree.srcPos, "\n\nSIP-53: https://docs.scala-lang.org/sips/quote-pattern-type-variable-syntax.html") warnOnInferredBounds(typeSym) @@ -225,7 +225,7 @@ trait QuotesAndSplices { if quoted.isType && untpdTypeVariables.nonEmpty then checkExperimentalFeature( - "explicit type variable declarations quoted type patterns (SIP-53)", + "Experimental explicit type variable declarations quoted type patterns (SIP-53)", untpdTypeVariables.head.srcPos, "\n\nSIP-53: https://docs.scala-lang.org/sips/quote-pattern-type-variable-syntax.html") diff --git a/compiler/test/dotty/tools/dotc/BootstrappedOnlyCompilationTests.scala b/compiler/test/dotty/tools/dotc/BootstrappedOnlyCompilationTests.scala index 9529f94a3890..55c6a7387ee1 100644 --- a/compiler/test/dotty/tools/dotc/BootstrappedOnlyCompilationTests.scala +++ b/compiler/test/dotty/tools/dotc/BootstrappedOnlyCompilationTests.scala @@ -191,7 +191,7 @@ class BootstrappedOnlyCompilationTests { val targets = dirs.map { dir => val compileDir = createOutputDirsForDir(dir, sourceDir, outDir) Files.copy(dir.toPath.resolve(pluginFile), compileDir.toPath.resolve(pluginFile), StandardCopyOption.REPLACE_EXISTING) - val flags = TestFlags(withCompilerClasspath, noCheckOptions).and("-Xplugin:" + compileDir.getAbsolutePath) + val flags = TestFlags(withCompilerClasspath, noCheckOptions).and("-Xplugin:" + compileDir.getAbsolutePath).and("-experimental") SeparateCompilationSource("testPlugins", dir, flags, compileDir) } diff --git a/compiler/test/dotty/tools/dotc/CompilationTests.scala b/compiler/test/dotty/tools/dotc/CompilationTests.scala index 78d7bdd3213d..e955897dd64f 100644 --- a/compiler/test/dotty/tools/dotc/CompilationTests.scala +++ b/compiler/test/dotty/tools/dotc/CompilationTests.scala @@ -35,7 +35,8 @@ class CompilationTests { compileFilesInDir("tests/pos-special/sourcepath/outer", defaultOptions.and("-sourcepath", "tests/pos-special/sourcepath")), compileFile("tests/pos-special/sourcepath/outer/nested/Test4.scala", defaultOptions.and("-sourcepath", "tests/pos-special/sourcepath")), compileFilesInDir("tests/pos-scala2", defaultOptions.and("-source", "3.0-migration")), - compileFilesInDir("tests/pos-custom-args/captures", defaultOptions.and("-language:experimental.captureChecking")), + compileFilesInDir("tests/pos-custom-args/captures", defaultOptions.and("-language:experimental.captureChecking", "-experimental")), + compileFilesInDir("tests/pos-custom-args/erased", defaultOptions.and("-language:experimental.erasedDefinitions", "-experimental", "-Ysafe-init")), compileFile("tests/pos-special/utf8encoded.scala", defaultOptions.and("-encoding", "UTF8")), compileFile("tests/pos-special/utf16encoded.scala", defaultOptions.and("-encoding", "UTF16")), // Run tests for legacy lazy vals @@ -125,7 +126,8 @@ class CompilationTests { aggregateTests( compileFilesInDir("tests/neg", defaultOptions), compileFilesInDir("tests/neg-deep-subtype", allowDeepSubtypes), - compileFilesInDir("tests/neg-custom-args/captures", defaultOptions.and("-language:experimental.captureChecking")), + compileFilesInDir("tests/neg-custom-args/captures", defaultOptions.and("-language:experimental.captureChecking", "-experimental")), + compileFilesInDir("tests/neg-custom-args/erased", defaultOptions.and("-language:experimental.erasedDefinitions", "-experimental")), compileFile("tests/neg-custom-args/sourcepath/outer/nested/Test1.scala", defaultOptions.and("-sourcepath", "tests/neg-custom-args/sourcepath")), compileDir("tests/neg-custom-args/sourcepath2/hi", defaultOptions.and("-sourcepath", "tests/neg-custom-args/sourcepath2", "-Xfatal-warnings")), compileList("duplicate source", List( @@ -148,7 +150,8 @@ class CompilationTests { aggregateTests( compileFilesInDir("tests/run", defaultOptions.and("-Ysafe-init")), compileFilesInDir("tests/run-deep-subtype", allowDeepSubtypes), - compileFilesInDir("tests/run-custom-args/captures", allowDeepSubtypes.and("-language:experimental.captureChecking")), + compileFilesInDir("tests/run-custom-args/captures", allowDeepSubtypes.and("-language:experimental.captureChecking", "-experimental")), + compileFilesInDir("tests/run-custom-args/erased", allowDeepSubtypes.and("-language:experimental.erasedDefinitions", "-experimental")), // Run tests for legacy lazy vals. compileFilesInDir("tests/run", defaultOptions.and("-Ysafe-init", "-Ylegacy-lazy-vals", "-Ycheck-constraint-deps"), FileFilter.include(TestSources.runLazyValsAllowlist)), ).checkRuns() diff --git a/docs/_docs/reference/changed-features/compiler-plugins.md b/docs/_docs/reference/changed-features/compiler-plugins.md index 82d38bd44d96..48d20808a06b 100644 --- a/docs/_docs/reference/changed-features/compiler-plugins.md +++ b/docs/_docs/reference/changed-features/compiler-plugins.md @@ -18,7 +18,7 @@ For experimentation and research, Scala 3 introduces _research plugin_. Research are more powerful than Scala 2 analyzer plugins as they let plugin authors customize the whole compiler pipeline. One can easily replace the standard typer by a custom one or create a parser for a domain-specific language. However, research plugins are only -enabled for nightly or snaphot releases of Scala 3. +enabled with the `-experimental` compiler flag. Common plugins that add new phases to the compiler pipeline are called _standard plugins_ in Scala 3. In terms of features, they are similar to diff --git a/docs/_docs/reference/experimental/overview.md b/docs/_docs/reference/experimental/overview.md index 254f103896e4..821d7bacbc43 100644 --- a/docs/_docs/reference/experimental/overview.md +++ b/docs/_docs/reference/experimental/overview.md @@ -21,6 +21,10 @@ They are enabled by importing the feature or using the `-language` compiler flag In general, experimental language features can be imported in an experimental scope (see [experimental definitions](../other-new-features/experimental-defs.md)). They can be imported at the top-level if all top-level definitions are `@experimental`. +### `-experimental` compiler flag + +This flag will make all top-level definitions have the `@experimental` annotation. This effectively enables the use of any experimental language feature in the project. + ## Experimental language features supported by special compiler options Some experimental language features that are still in research and development can be enabled with special compiler options. These include diff --git a/docs/_docs/reference/other-new-features/experimental-defs.md b/docs/_docs/reference/other-new-features/experimental-defs.md index 88815ad1e136..68cebaf733cb 100644 --- a/docs/_docs/reference/other-new-features/experimental-defs.md +++ b/docs/_docs/reference/other-new-features/experimental-defs.md @@ -265,8 +265,7 @@ 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. +6. Any code compiled using the `-experimental` compiler flag considered to be in an experimental scope. In any other situation, a reference to an experimental definition will cause a compilation error. @@ -309,3 +308,7 @@ class MyExperimentalTests { ``` + +## `-experimental` compiler flag + +This flag will make all top-level definitions have the `@experimental` annotation. This effectively enables the use of any experimental definition or language feature in the project. diff --git a/project/Build.scala b/project/Build.scala index ee1ed242e1b2..9f95e2429498 100644 --- a/project/Build.scala +++ b/project/Build.scala @@ -2026,9 +2026,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/tests/coverage/run/erased/test.scala b/tests/coverage/run/erased/test.scala index 15a067e9ed50..b42ade9311d0 100644 --- a/tests/coverage/run/erased/test.scala +++ b/tests/coverage/run/erased/test.scala @@ -1,3 +1,5 @@ +//> using options -experimental + import scala.language.experimental.erasedDefinitions erased def parameterless: String = "y" diff --git a/tests/coverage/run/erased/test.scoverage.check b/tests/coverage/run/erased/test.scoverage.check index f31c1a2418a9..b86ab873c7ad 100644 --- a/tests/coverage/run/erased/test.scoverage.check +++ b/tests/coverage/run/erased/test.scoverage.check @@ -25,9 +25,9 @@ test$package$ Object .test$package$ foo -181 -203 -6 +214 +236 +8 println Apply false @@ -42,9 +42,9 @@ test$package$ Object .test$package$ foo -189 -202 -6 +222 +235 +8 s Apply false @@ -59,9 +59,9 @@ test$package$ Object .test$package$ foo -132 -139 -5 +165 +172 +7 foo DefDef false @@ -76,9 +76,9 @@ test$package$ Object .test$package$ identity -245 -269 -10 +278 +302 +12 println Apply false @@ -93,9 +93,9 @@ test$package$ Object .test$package$ identity -253 -268 -10 +286 +301 +12 s Apply false @@ -110,9 +110,9 @@ test$package$ Object .test$package$ identity -209 -221 -9 +242 +254 +11 identity DefDef false @@ -127,9 +127,9 @@ test$package$ Object .test$package$ Test -300 -323 -15 +333 +356 +17 foo Apply false @@ -144,9 +144,9 @@ test$package$ Object .test$package$ Test -326 -342 -16 +359 +375 +18 foo Apply false @@ -161,9 +161,9 @@ test$package$ Object .test$package$ Test -345 -374 -17 +378 +407 +19 foo Apply false @@ -178,9 +178,9 @@ test$package$ Object .test$package$ Test -357 -373 -17 +390 +406 +19 identity Apply false @@ -195,9 +195,9 @@ test$package$ Object .test$package$ Test -275 -289 -14 +308 +322 +16 Test DefDef false diff --git a/tests/init-global/pos/global-region1.scala b/tests/init-global/pos/global-region1.scala index db56fe45e1a4..85e925967337 100644 --- a/tests/init-global/pos/global-region1.scala +++ b/tests/init-global/pos/global-region1.scala @@ -1,3 +1,5 @@ +//> using options -experimental + import scala.annotation.init.region trait B { def foo(): Int } diff --git a/tests/init/pos/interleaving-overload.scala b/tests/init/pos/interleaving-overload.scala index 260b3538214a..77834559d018 100755 --- a/tests/init/pos/interleaving-overload.scala +++ b/tests/init/pos/interleaving-overload.scala @@ -1,3 +1,5 @@ +//> using options -experimental + import scala.language.experimental.clauseInterleaving class A{ diff --git a/tests/init/pos/interleaving-params.scala b/tests/init/pos/interleaving-params.scala index 9f98b5f35d5b..d81975565778 100755 --- a/tests/init/pos/interleaving-params.scala +++ b/tests/init/pos/interleaving-params.scala @@ -1,3 +1,5 @@ +//> using options -experimental + import scala.collection.mutable.AbstractSet import scala.collection.mutable.BitSet import scala.language.experimental.clauseInterleaving diff --git a/tests/neg/erased-class.scala b/tests/neg-custom-args/erased/erased-class.scala similarity index 100% rename from tests/neg/erased-class.scala rename to tests/neg-custom-args/erased/erased-class.scala diff --git a/tests/neg/erased-inheritance.scala b/tests/neg-custom-args/erased/erased-inheritance.scala similarity index 100% rename from tests/neg/erased-inheritance.scala rename to tests/neg-custom-args/erased/erased-inheritance.scala diff --git a/tests/neg/erasedInline.scala b/tests/neg-custom-args/erased/erasedInline.scala similarity index 100% rename from tests/neg/erasedInline.scala rename to tests/neg-custom-args/erased/erasedInline.scala diff --git a/tests/neg/polymorphic-erased-functions-types.scala b/tests/neg-custom-args/erased/polymorphic-erased-functions-types.scala similarity index 100% rename from tests/neg/polymorphic-erased-functions-types.scala rename to tests/neg-custom-args/erased/polymorphic-erased-functions-types.scala diff --git a/tests/neg/polymorphic-erased-functions-used.scala b/tests/neg-custom-args/erased/polymorphic-erased-functions-used.scala similarity index 100% rename from tests/neg/polymorphic-erased-functions-used.scala rename to tests/neg-custom-args/erased/polymorphic-erased-functions-used.scala diff --git a/tests/neg/safeThrowsStrawman.scala b/tests/neg-custom-args/erased/safeThrowsStrawman.scala similarity index 100% rename from tests/neg/safeThrowsStrawman.scala rename to tests/neg-custom-args/erased/safeThrowsStrawman.scala diff --git a/tests/neg/safeThrowsStrawman2.scala b/tests/neg-custom-args/erased/safeThrowsStrawman2.scala similarity index 100% rename from tests/neg/safeThrowsStrawman2.scala rename to tests/neg-custom-args/erased/safeThrowsStrawman2.scala diff --git a/tests/neg-macros/BigFloat/BigFloat_1.scala b/tests/neg-macros/BigFloat/BigFloat_1.scala index 5bb5b49587bd..b7f143eae42b 100644 --- a/tests/neg-macros/BigFloat/BigFloat_1.scala +++ b/tests/neg-macros/BigFloat/BigFloat_1.scala @@ -1,3 +1,5 @@ +//> using options -experimental + package test import language.experimental.genericNumberLiterals import scala.util.FromDigits diff --git a/tests/neg-macros/BigFloat/Test_2.scala b/tests/neg-macros/BigFloat/Test_2.scala index fa7e6a8380e2..081a8320d9fd 100644 --- a/tests/neg-macros/BigFloat/Test_2.scala +++ b/tests/neg-macros/BigFloat/Test_2.scala @@ -1,3 +1,5 @@ +//> using options -experimental + import test.BigFloat object Test extends App { val x: BigFloat = 1234.45e3333333333 // error: exponent too large diff --git a/tests/neg-macros/GenericNumLits/Even_1.scala b/tests/neg-macros/GenericNumLits/Even_1.scala index 24bcf32cc7c0..314484f5bf15 100644 --- a/tests/neg-macros/GenericNumLits/Even_1.scala +++ b/tests/neg-macros/GenericNumLits/Even_1.scala @@ -1,3 +1,5 @@ +//> using options -experimental + import language.experimental.genericNumberLiterals import scala.util.FromDigits import scala.quoted.* diff --git a/tests/neg-macros/GenericNumLits/Test_2.scala b/tests/neg-macros/GenericNumLits/Test_2.scala index 37b5ebab553e..c507c0a0e3ca 100644 --- a/tests/neg-macros/GenericNumLits/Test_2.scala +++ b/tests/neg-macros/GenericNumLits/Test_2.scala @@ -1,3 +1,5 @@ +//> using options -experimental + import language.experimental.genericNumberLiterals object Test extends App { diff --git a/tests/neg-macros/macro-experimental.scala b/tests/neg-macros/macro-experimental.scala index eaa822d4b541..dc011f4e45b9 100644 --- a/tests/neg-macros/macro-experimental.scala +++ b/tests/neg-macros/macro-experimental.scala @@ -1,5 +1,3 @@ -//> using options -Yno-experimental - import scala.quoted.* import scala.annotation.experimental diff --git a/tests/neg-macros/newClassExtendsNoParents/Macro_1.scala b/tests/neg-macros/newClassExtendsNoParents/Macro_1.scala index 5280ffba0f53..0a64bf320b72 100644 --- a/tests/neg-macros/newClassExtendsNoParents/Macro_1.scala +++ b/tests/neg-macros/newClassExtendsNoParents/Macro_1.scala @@ -1,3 +1,5 @@ +//> using options -experimental + import scala.quoted.* inline def makeClass(inline name: String): Any = ${ makeClassExpr('name) } diff --git a/tests/neg-macros/newClassExtendsNoParents/Test_2.scala b/tests/neg-macros/newClassExtendsNoParents/Test_2.scala index eada3ba7e67a..da8b3d84b522 100644 --- a/tests/neg-macros/newClassExtendsNoParents/Test_2.scala +++ b/tests/neg-macros/newClassExtendsNoParents/Test_2.scala @@ -1 +1,3 @@ +//> using options -experimental + def test: Any = makeClass("foo") // error diff --git a/tests/neg-macros/newClassExtendsOnlyTrait/Macro_1.scala b/tests/neg-macros/newClassExtendsOnlyTrait/Macro_1.scala index d1fd45399157..6ced5bf34462 100644 --- a/tests/neg-macros/newClassExtendsOnlyTrait/Macro_1.scala +++ b/tests/neg-macros/newClassExtendsOnlyTrait/Macro_1.scala @@ -1,3 +1,5 @@ +//> using options -experimental + import scala.quoted.* inline def makeClass(inline name: String): Foo = ${ makeClassExpr('name) } diff --git a/tests/neg-macros/newClassExtendsOnlyTrait/Test_2.scala b/tests/neg-macros/newClassExtendsOnlyTrait/Test_2.scala index d8636c811214..7bb465eae617 100644 --- a/tests/neg-macros/newClassExtendsOnlyTrait/Test_2.scala +++ b/tests/neg-macros/newClassExtendsOnlyTrait/Test_2.scala @@ -1 +1,3 @@ +//> using options -experimental + def test: Foo = makeClass("foo") // error diff --git a/tests/neg-macros/quote-pattern-type-var-bounds.scala b/tests/neg-macros/quote-pattern-type-var-bounds.scala index b97b21552a1e..52d6bb1d0c9e 100644 --- a/tests/neg-macros/quote-pattern-type-var-bounds.scala +++ b/tests/neg-macros/quote-pattern-type-var-bounds.scala @@ -1,3 +1,5 @@ +//> using options -experimental + import scala.quoted.* def types(t: Type[?])(using Quotes) = t match { case '[ type t; Int ] => diff --git a/tests/neg-macros/quote-type-variable-no-inference-2.check b/tests/neg-macros/quote-type-variable-no-inference-2.check index f479c34bf8e8..74ed70e63b41 100644 --- a/tests/neg-macros/quote-type-variable-no-inference-2.check +++ b/tests/neg-macros/quote-type-variable-no-inference-2.check @@ -1,12 +1,12 @@ --- Warning: tests/neg-macros/quote-type-variable-no-inference-2.scala:5:22 --------------------------------------------- -5 | case '{ $_ : F[t, t]; () } => // warn // error +-- Warning: tests/neg-macros/quote-type-variable-no-inference-2.scala:7:22 --------------------------------------------- +7 | case '{ $_ : F[t, t]; () } => // warn // error | ^ | Ignored bound <: Double | | Consider defining bounds explicitly: | '{ type t <: Int & Double; ... } --- [E057] Type Mismatch Error: tests/neg-macros/quote-type-variable-no-inference-2.scala:5:20 -------------------------- -5 | case '{ $_ : F[t, t]; () } => // warn // error +-- [E057] Type Mismatch Error: tests/neg-macros/quote-type-variable-no-inference-2.scala:7:20 -------------------------- +7 | case '{ $_ : F[t, t]; () } => // warn // error | ^ | Type argument t does not conform to upper bound Double | diff --git a/tests/neg-macros/quote-type-variable-no-inference-2.scala b/tests/neg-macros/quote-type-variable-no-inference-2.scala index 1cb0d3dab7b3..83b1c6493e37 100644 --- a/tests/neg-macros/quote-type-variable-no-inference-2.scala +++ b/tests/neg-macros/quote-type-variable-no-inference-2.scala @@ -1,3 +1,5 @@ +//> using options -experimental + import scala.quoted.* def test2(x: Expr[Any])(using Quotes) = diff --git a/tests/neg-macros/quote-type-variable-no-inference-3.check b/tests/neg-macros/quote-type-variable-no-inference-3.check index 91476728654d..248729701961 100644 --- a/tests/neg-macros/quote-type-variable-no-inference-3.check +++ b/tests/neg-macros/quote-type-variable-no-inference-3.check @@ -1,19 +1,19 @@ --- Warning: tests/neg-macros/quote-type-variable-no-inference-3.scala:5:22 --------------------------------------------- -5 | case '{ $_ : F[t, t]; () } => // warn // error +-- Warning: tests/neg-macros/quote-type-variable-no-inference-3.scala:7:22 --------------------------------------------- +7 | case '{ $_ : F[t, t]; () } => // warn // error | ^ | Ignored bound <: Comparable[U] | | Consider defining bounds explicitly: | '{ type t <: Comparable[U]; ... } --- Warning: tests/neg-macros/quote-type-variable-no-inference-3.scala:6:49 --------------------------------------------- -6 | case '{ type u <: Comparable[`u`]; $_ : F[u, u] } => +-- Warning: tests/neg-macros/quote-type-variable-no-inference-3.scala:8:49 --------------------------------------------- +8 | case '{ type u <: Comparable[`u`]; $_ : F[u, u] } => | ^ | Ignored bound <: Comparable[Any] | | Consider defining bounds explicitly: | '{ type u <: Comparable[u] & Comparable[Any]; ... } --- [E057] Type Mismatch Error: tests/neg-macros/quote-type-variable-no-inference-3.scala:5:20 -------------------------- -5 | case '{ $_ : F[t, t]; () } => // warn // error +-- [E057] Type Mismatch Error: tests/neg-macros/quote-type-variable-no-inference-3.scala:7:20 -------------------------- +7 | case '{ $_ : F[t, t]; () } => // warn // error | ^ | Type argument t does not conform to upper bound Comparable[t] | diff --git a/tests/neg-macros/quote-type-variable-no-inference-3.scala b/tests/neg-macros/quote-type-variable-no-inference-3.scala index 04e3c4ef931e..18ceebafe105 100644 --- a/tests/neg-macros/quote-type-variable-no-inference-3.scala +++ b/tests/neg-macros/quote-type-variable-no-inference-3.scala @@ -1,3 +1,5 @@ +//> using options -experimental + import scala.quoted.* def test2(x: Expr[Any])(using Quotes) = diff --git a/tests/neg-macros/quote-type-variable-no-inference.check b/tests/neg-macros/quote-type-variable-no-inference.check index 9de69c51f79b..dfdc95c5a6ef 100644 --- a/tests/neg-macros/quote-type-variable-no-inference.check +++ b/tests/neg-macros/quote-type-variable-no-inference.check @@ -1,12 +1,12 @@ --- Warning: tests/neg-macros/quote-type-variable-no-inference.scala:5:17 ----------------------------------------------- -5 | case '[ F[t, t] ] => // warn // error +-- Warning: tests/neg-macros/quote-type-variable-no-inference.scala:7:17 ----------------------------------------------- +7 | case '[ F[t, t] ] => // warn // error | ^ | Ignored bound <: Double | | Consider defining bounds explicitly: | '[ type t <: Int & Double; ... ] --- [E057] Type Mismatch Error: tests/neg-macros/quote-type-variable-no-inference.scala:5:15 ---------------------------- -5 | case '[ F[t, t] ] => // warn // error +-- [E057] Type Mismatch Error: tests/neg-macros/quote-type-variable-no-inference.scala:7:15 ---------------------------- +7 | case '[ F[t, t] ] => // warn // error | ^ | Type argument t does not conform to upper bound Double | diff --git a/tests/neg-macros/quote-type-variable-no-inference.scala b/tests/neg-macros/quote-type-variable-no-inference.scala index de03f4445302..3cd8955f956a 100644 --- a/tests/neg-macros/quote-type-variable-no-inference.scala +++ b/tests/neg-macros/quote-type-variable-no-inference.scala @@ -1,3 +1,5 @@ +//> using options -experimental + import scala.quoted.* def test(x: Type[?])(using Quotes) = diff --git a/tests/neg-macros/quotedPatterns-5.scala b/tests/neg-macros/quotedPatterns-5.scala index 9c47fd31dab4..5b3d536d690e 100644 --- a/tests/neg-macros/quotedPatterns-5.scala +++ b/tests/neg-macros/quotedPatterns-5.scala @@ -1,3 +1,5 @@ +//> using options -experimental + import scala.quoted.* object Test { def test(x: quoted.Expr[Int])(using Quotes): Unit = x match { diff --git a/tests/neg-with-compiler/GenericNumLits/EvenFromDigitsImpl_1.scala b/tests/neg-with-compiler/GenericNumLits/EvenFromDigitsImpl_1.scala index 2c8e0d088ea8..24c316beb363 100644 --- a/tests/neg-with-compiler/GenericNumLits/EvenFromDigitsImpl_1.scala +++ b/tests/neg-with-compiler/GenericNumLits/EvenFromDigitsImpl_1.scala @@ -1,3 +1,5 @@ +//> using options -experimental + import language.experimental.genericNumberLiterals import scala.util.FromDigits import scala.quoted.* diff --git a/tests/neg-with-compiler/GenericNumLits/Test_2.scala b/tests/neg-with-compiler/GenericNumLits/Test_2.scala index 579fca249337..8563f9b74518 100644 --- a/tests/neg-with-compiler/GenericNumLits/Test_2.scala +++ b/tests/neg-with-compiler/GenericNumLits/Test_2.scala @@ -1,3 +1,5 @@ +//> using options -experimental + import language.experimental.genericNumberLiterals object Test extends App { diff --git a/tests/neg/14034.scala b/tests/neg/14034.scala index bdb09a011777..ab824c43395e 100644 --- a/tests/neg/14034.scala +++ b/tests/neg/14034.scala @@ -1,5 +1,3 @@ -//> using options -Yno-experimental - import annotation.experimental @experimental trait Exp diff --git a/tests/neg/by-name.scala b/tests/neg/by-name.scala index 74b003f56044..2e569042f0ab 100644 --- a/tests/neg/by-name.scala +++ b/tests/neg/by-name.scala @@ -1,4 +1,4 @@ -//> using options -language:experimental.erasedDefinitions +//> using options -experimental -language:experimental.erasedDefinitions def f(x: => Int, erased y: => Int) = x // error def g(erased x: => Int, y: => Int) = y // error diff --git a/tests/neg/capt-wf.scala b/tests/neg/capt-wf.scala index 0e1e4be2ca67..0f38ef2b560e 100644 --- a/tests/neg/capt-wf.scala +++ b/tests/neg/capt-wf.scala @@ -1,4 +1,4 @@ -//> using options -language:experimental.captureChecking -Xfatal-warnings +//> using options -experimental -language:experimental.captureChecking -Xfatal-warnings class C type Cap = C^ diff --git a/tests/neg/deptypes.scala b/tests/neg/deptypes.scala index 39b1e42ccbca..4027d0bbdcd9 100644 --- a/tests/neg/deptypes.scala +++ b/tests/neg/deptypes.scala @@ -1,4 +1,4 @@ -//> using options -language:experimental.dependent +//> using options -experimental -language:experimental.dependent type Vec[T] = (n: Int) =>> Array[T] // error: not yet implemented diff --git a/tests/neg/erased-1.scala b/tests/neg/erased-1.scala index 62a1024e80f5..2c08533401e6 100644 --- a/tests/neg/erased-1.scala +++ b/tests/neg/erased-1.scala @@ -1,4 +1,4 @@ -//> using options -language:experimental.erasedDefinitions +//> using options -experimental -language:experimental.erasedDefinitions object Test { def foo0(a: Int): Int = a diff --git a/tests/neg/erased-2.scala b/tests/neg/erased-2.scala index 02e4b56e11ac..0b4d3af6ac34 100644 --- a/tests/neg/erased-2.scala +++ b/tests/neg/erased-2.scala @@ -1,4 +1,4 @@ -//> using options -language:experimental.erasedDefinitions +//> using options -experimental -language:experimental.erasedDefinitions object Test { def foo0(a: Int): Int = a diff --git a/tests/neg/erased-24.scala b/tests/neg/erased-24.scala index bf2f1d21435e..942aadaeadc5 100644 --- a/tests/neg/erased-24.scala +++ b/tests/neg/erased-24.scala @@ -1,4 +1,4 @@ -//> using options -language:experimental.erasedDefinitions +//> using options -experimental -language:experimental.erasedDefinitions // Could become a run test if we had totality checking for erased arguments diff --git a/tests/neg/erased-3.scala b/tests/neg/erased-3.scala index 5c6a31860b11..6b8db57a78bf 100644 --- a/tests/neg/erased-3.scala +++ b/tests/neg/erased-3.scala @@ -1,4 +1,4 @@ -//> using options -language:experimental.erasedDefinitions +//> using options -experimental -language:experimental.erasedDefinitions object Test { def foo0(a: Int): Int = a diff --git a/tests/neg/erased-4.scala b/tests/neg/erased-4.scala index 46b101acafd4..15b7a762d372 100644 --- a/tests/neg/erased-4.scala +++ b/tests/neg/erased-4.scala @@ -1,4 +1,4 @@ -//> using options -language:experimental.erasedDefinitions +//> using options -experimental -language:experimental.erasedDefinitions object Test { diff --git a/tests/neg/erased-5.scala b/tests/neg/erased-5.scala index 2d88b9f90d9f..36f666a2e96b 100644 --- a/tests/neg/erased-5.scala +++ b/tests/neg/erased-5.scala @@ -1,4 +1,4 @@ -//> using options -language:experimental.erasedDefinitions +//> using options -experimental -language:experimental.erasedDefinitions object Test { diff --git a/tests/neg/erased-6.scala b/tests/neg/erased-6.scala index 4585ab876b3d..5d92e6e9f99e 100644 --- a/tests/neg/erased-6.scala +++ b/tests/neg/erased-6.scala @@ -1,4 +1,4 @@ -//> using options -language:experimental.erasedDefinitions +//> using options -experimental -language:experimental.erasedDefinitions object Test { erased def foo: Foo = new Foo diff --git a/tests/neg/erased-args-lifted.scala b/tests/neg/erased-args-lifted.scala index 2deee749ed3d..e162540a8490 100644 --- a/tests/neg/erased-args-lifted.scala +++ b/tests/neg/erased-args-lifted.scala @@ -1,4 +1,4 @@ -//> using options -language:experimental.erasedDefinitions +//> using options -experimental -language:experimental.erasedDefinitions object Test { def foo(a: Int)(b: Int, c: Int) = 42 diff --git a/tests/neg/erased-assign.scala b/tests/neg/erased-assign.scala index 5026ca3f1856..8f2f3a309ac7 100644 --- a/tests/neg/erased-assign.scala +++ b/tests/neg/erased-assign.scala @@ -1,4 +1,4 @@ -//> using options -language:experimental.erasedDefinitions +//> using options -experimental -language:experimental.erasedDefinitions object Test { var i: Int = 1 diff --git a/tests/neg/erased-case-class.scala b/tests/neg/erased-case-class.scala index 5fdda47d5257..e26e1f1bf133 100644 --- a/tests/neg/erased-case-class.scala +++ b/tests/neg/erased-case-class.scala @@ -1,3 +1,3 @@ -//> using options -language:experimental.erasedDefinitions +//> using options -experimental -language:experimental.erasedDefinitions case class Foo1(erased x: Int) // error // error diff --git a/tests/neg/erased-def-rhs.scala b/tests/neg/erased-def-rhs.scala index a57b9b1c149e..8b5892b2df04 100644 --- a/tests/neg/erased-def-rhs.scala +++ b/tests/neg/erased-def-rhs.scala @@ -1,4 +1,4 @@ -//> using options -language:experimental.erasedDefinitions +//> using options -experimental -language:experimental.erasedDefinitions object Test { def f(erased i: Int) = { diff --git a/tests/neg/erased-if-else.scala b/tests/neg/erased-if-else.scala index d879f0ebf2e7..f2f45455bfb5 100644 --- a/tests/neg/erased-if-else.scala +++ b/tests/neg/erased-if-else.scala @@ -1,4 +1,4 @@ -//> using options -language:experimental.erasedDefinitions +//> using options -experimental -language:experimental.erasedDefinitions object Test { var b = true diff --git a/tests/neg/erased-implicit.scala b/tests/neg/erased-implicit.scala index 28fca7427942..9ad7aee07c55 100644 --- a/tests/neg/erased-implicit.scala +++ b/tests/neg/erased-implicit.scala @@ -1,4 +1,4 @@ -//> using options -language:experimental.erasedDefinitions +//> using options -experimental -language:experimental.erasedDefinitions object Test { diff --git a/tests/neg/erased-in-tuples.scala b/tests/neg/erased-in-tuples.scala index d1567c8e3a47..f9a7f8147a09 100644 --- a/tests/neg/erased-in-tuples.scala +++ b/tests/neg/erased-in-tuples.scala @@ -1,4 +1,4 @@ -//> using options -language:experimental.erasedDefinitions +//> using options -experimental -language:experimental.erasedDefinitions @main def Test() = val x = 5 diff --git a/tests/neg/erased-lazy-val.scala b/tests/neg/erased-lazy-val.scala index 271f87cc2cf0..8f3bb68bd1b8 100644 --- a/tests/neg/erased-lazy-val.scala +++ b/tests/neg/erased-lazy-val.scala @@ -1,4 +1,4 @@ -//> using options -language:experimental.erasedDefinitions +//> using options -experimental -language:experimental.erasedDefinitions object Test { erased lazy val i: Int = 1 // error diff --git a/tests/neg/erased-machine-state-encoding-with-inline.scala b/tests/neg/erased-machine-state-encoding-with-inline.scala index f6f2acd48766..f5844328aaa0 100644 --- a/tests/neg/erased-machine-state-encoding-with-inline.scala +++ b/tests/neg/erased-machine-state-encoding-with-inline.scala @@ -1,4 +1,4 @@ -//> using options -language:experimental.erasedDefinitions +//> using options -experimental -language:experimental.erasedDefinitions import scala.compiletime.* diff --git a/tests/neg/erased-match.scala b/tests/neg/erased-match.scala index d05a0c7e0f03..c163e5bdb526 100644 --- a/tests/neg/erased-match.scala +++ b/tests/neg/erased-match.scala @@ -1,4 +1,4 @@ -//> using options -language:experimental.erasedDefinitions +//> using options -experimental -language:experimental.erasedDefinitions object Test { var b = true diff --git a/tests/neg/erased-object.scala b/tests/neg/erased-object.scala index 6f616d02010f..951a087463bc 100644 --- a/tests/neg/erased-object.scala +++ b/tests/neg/erased-object.scala @@ -1,3 +1,3 @@ -//> using options -language:experimental.erasedDefinitions +//> using options -experimental -language:experimental.erasedDefinitions erased object Test // error diff --git a/tests/neg/erased-path.scala b/tests/neg/erased-path.scala index ece90e563483..2397c8e4401e 100644 --- a/tests/neg/erased-path.scala +++ b/tests/neg/erased-path.scala @@ -1,4 +1,4 @@ -//> using options -language:experimental.erasedDefinitions +//> using options -experimental -language:experimental.erasedDefinitions trait Sys { type X } diff --git a/tests/neg/erased-pathdep-1.scala b/tests/neg/erased-pathdep-1.scala index 422ceb5e37fe..bcea57c57769 100644 --- a/tests/neg/erased-pathdep-1.scala +++ b/tests/neg/erased-pathdep-1.scala @@ -1,4 +1,4 @@ -//> using options -language:experimental.erasedDefinitions +//> using options -experimental -language:experimental.erasedDefinitions // Could become a neg test if we had totality checking for erased arguments diff --git a/tests/neg/erased-pathdep-2.scala b/tests/neg/erased-pathdep-2.scala index 0b50acbf3b30..4c0a6555a29d 100644 --- a/tests/neg/erased-pathdep-2.scala +++ b/tests/neg/erased-pathdep-2.scala @@ -1,4 +1,4 @@ -//> using options -language:experimental.erasedDefinitions +//> using options -experimental -language:experimental.erasedDefinitions // Could become a neg test if we had totality checking for erased arguments diff --git a/tests/neg/erased-return.scala b/tests/neg/erased-return.scala index f1abdef1df22..10c6828a8560 100644 --- a/tests/neg/erased-return.scala +++ b/tests/neg/erased-return.scala @@ -1,4 +1,4 @@ -//> using options -language:experimental.erasedDefinitions +//> using options -experimental -language:experimental.erasedDefinitions object Test { var b = true diff --git a/tests/neg/erased-singleton.scala b/tests/neg/erased-singleton.scala index 5ffa78e24b07..2701911cab50 100644 --- a/tests/neg/erased-singleton.scala +++ b/tests/neg/erased-singleton.scala @@ -1,4 +1,4 @@ -//> using options -language:experimental.erasedDefinitions +//> using options -experimental -language:experimental.erasedDefinitions trait Sys diff --git a/tests/neg/erased-try.scala b/tests/neg/erased-try.scala index 0de3732a4e6e..362cc4f5e1ea 100644 --- a/tests/neg/erased-try.scala +++ b/tests/neg/erased-try.scala @@ -1,4 +1,4 @@ -//> using options -language:experimental.erasedDefinitions +//> using options -experimental -language:experimental.erasedDefinitions object Test { def foo(erased a: Int): Int = { diff --git a/tests/neg/erased-type.scala b/tests/neg/erased-type.scala index 4df6780ff2f4..32db225f59db 100644 --- a/tests/neg/erased-type.scala +++ b/tests/neg/erased-type.scala @@ -1,4 +1,4 @@ -//> using options -language:experimental.erasedDefinitions +//> using options -experimental -language:experimental.erasedDefinitions class Test { erased type T // error diff --git a/tests/neg/erased-val-rhs.scala b/tests/neg/erased-val-rhs.scala index f8bb838e4298..6a08eee45398 100644 --- a/tests/neg/erased-val-rhs.scala +++ b/tests/neg/erased-val-rhs.scala @@ -1,4 +1,4 @@ -//> using options -language:experimental.erasedDefinitions +//> using options -experimental -language:experimental.erasedDefinitions object Test { def f(erased i: Int) = { diff --git a/tests/neg/erased-value-class.scala b/tests/neg/erased-value-class.scala index 81dfeeee3e1c..118b4be8f0c4 100644 --- a/tests/neg/erased-value-class.scala +++ b/tests/neg/erased-value-class.scala @@ -1,4 +1,4 @@ -//> using options -language:experimental.erasedDefinitions +//> using options -experimental -language:experimental.erasedDefinitions class Foo(erased x: Int) extends AnyVal // error diff --git a/tests/neg/erased-var.scala b/tests/neg/erased-var.scala index 51c9221e3bd9..a66d36a11223 100644 --- a/tests/neg/erased-var.scala +++ b/tests/neg/erased-var.scala @@ -1,4 +1,4 @@ -//> using options -language:experimental.erasedDefinitions +//> using options -experimental -language:experimental.erasedDefinitions object Test { erased var i: Int = 1 // error diff --git a/tests/neg/erasedValueb.scala b/tests/neg/erasedValueb.scala index 5c1f1d359e93..7f7c3d038706 100644 --- a/tests/neg/erasedValueb.scala +++ b/tests/neg/erasedValueb.scala @@ -1,4 +1,4 @@ -//> using options -language:experimental.erasedDefinitions +//> using options -experimental -language:experimental.erasedDefinitions import scala.compiletime.erasedValue object Test { diff --git a/tests/neg/expeimental-flag-with-lang-feature-1.scala b/tests/neg/expeimental-flag-with-lang-feature-1.scala new file mode 100644 index 000000000000..08afe4e48a06 --- /dev/null +++ b/tests/neg/expeimental-flag-with-lang-feature-1.scala @@ -0,0 +1,3 @@ +import scala.language.experimental.erasedDefinitions + +erased def erasedFun(erased x: Int): Int = x // error // error diff --git a/tests/neg/expeimental-flag-with-lang-feature-2.scala b/tests/neg/expeimental-flag-with-lang-feature-2.scala new file mode 100644 index 000000000000..d1f1c288201c --- /dev/null +++ b/tests/neg/expeimental-flag-with-lang-feature-2.scala @@ -0,0 +1,5 @@ +import scala.language.experimental.namedTypeArguments // error + +def namedTypeArgumentsFun[T, U]: Int = + namedTypeArgumentsFun[T = Int, U = Int] + namedTypeArgumentsFun[U = Int, T = Int] diff --git a/tests/neg/expeimental-flag.scala b/tests/neg/expeimental-flag.scala new file mode 100644 index 000000000000..401d76076161 --- /dev/null +++ b/tests/neg/expeimental-flag.scala @@ -0,0 +1,16 @@ +import scala.annotation.experimental + +class Foo: + def foo: Int = experimentalDef // error + +class Bar: + def bar: Int = experimentalDef // error +object Bar: + def bar: Int = experimentalDef // error + +object Baz: + def bar: Int = experimentalDef // error + +def toplevelMethod: Int = experimentalDef // error + +@experimental def experimentalDef: Int = 1 diff --git a/tests/neg/experimental-2.scala b/tests/neg/experimental-2.scala index f2d0262d83f5..e2a8dcef58b8 100644 --- a/tests/neg/experimental-2.scala +++ b/tests/neg/experimental-2.scala @@ -1,5 +1,3 @@ -//> using options -Yno-experimental - class Test7 { import scala.language.experimental import experimental.genericNumberLiterals // error: no aliases can be used to refer to a language import diff --git a/tests/neg/experimental-erased.scala b/tests/neg/experimental-erased.scala index 3619d0059a95..c80c3e0d4b49 100644 --- a/tests/neg/experimental-erased.scala +++ b/tests/neg/experimental-erased.scala @@ -1,5 +1,3 @@ -//> using options -Yno-experimental - import language.experimental.erasedDefinitions import annotation.experimental diff --git a/tests/neg/experimental-imports.scala b/tests/neg/experimental-imports.scala index 3a672ac65a22..63a150978b1c 100644 --- a/tests/neg/experimental-imports.scala +++ b/tests/neg/experimental-imports.scala @@ -1,5 +1,3 @@ -//> using options -Yno-experimental - import annotation.experimental @experimental diff --git a/tests/neg/experimental-nested-imports-2.scala b/tests/neg/experimental-nested-imports-2.scala index 4aac719a81d6..a4962c6153a0 100644 --- a/tests/neg/experimental-nested-imports-2.scala +++ b/tests/neg/experimental-nested-imports-2.scala @@ -1,5 +1,3 @@ -//> using options -Yno-experimental - import annotation.experimental class Class1: diff --git a/tests/neg/experimental-nested-imports-3.scala b/tests/neg/experimental-nested-imports-3.scala index 39b548b2586b..77fbe41479d2 100644 --- a/tests/neg/experimental-nested-imports-3.scala +++ b/tests/neg/experimental-nested-imports-3.scala @@ -1,5 +1,3 @@ -//> using options -Yno-experimental - import annotation.experimental class Class1: diff --git a/tests/neg/experimental-nested-imports.scala b/tests/neg/experimental-nested-imports.scala index 91fe3bfeb27b..180c43b9f671 100644 --- a/tests/neg/experimental-nested-imports.scala +++ b/tests/neg/experimental-nested-imports.scala @@ -1,5 +1,3 @@ -//> using options -Yno-experimental - import annotation.experimental class Class1: diff --git a/tests/neg/experimental-package-imports.scala b/tests/neg/experimental-package-imports.scala index 7a4b04606b9d..047b3eb61e82 100644 --- a/tests/neg/experimental-package-imports.scala +++ b/tests/neg/experimental-package-imports.scala @@ -1,5 +1,3 @@ -//> using options -Yno-experimental - import annotation.experimental package foo { diff --git a/tests/neg/experimental.scala b/tests/neg/experimental.scala index efca9a26ec14..42d0d8066c35 100644 --- a/tests/neg/experimental.scala +++ b/tests/neg/experimental.scala @@ -1,5 +1,3 @@ -//> using options -Yno-experimental - class Test0 { import language.experimental.namedTypeArguments // error object Foo { diff --git a/tests/neg/experimentalAnnot.scala b/tests/neg/experimentalAnnot.scala index e50d9165b5a4..e6dfbf28f8bb 100644 --- a/tests/neg/experimentalAnnot.scala +++ b/tests/neg/experimentalAnnot.scala @@ -1,5 +1,3 @@ -//> using options -Yno-experimental - import scala.annotation.experimental @experimental class myExperimentalAnnot extends scala.annotation.Annotation diff --git a/tests/neg/experimentalCaseClass.scala b/tests/neg/experimentalCaseClass.scala index 383824954041..b112c8a1213a 100644 --- a/tests/neg/experimentalCaseClass.scala +++ b/tests/neg/experimentalCaseClass.scala @@ -1,5 +1,3 @@ -//> using options -Yno-experimental - import scala.annotation.experimental @experimental diff --git a/tests/neg/experimentalDefaultParams.scala b/tests/neg/experimentalDefaultParams.scala index fb9ffa282e60..4dedb3afa11d 100644 --- a/tests/neg/experimentalDefaultParams.scala +++ b/tests/neg/experimentalDefaultParams.scala @@ -1,5 +1,3 @@ -//> using options -Yno-experimental - import scala.annotation.experimental @experimental def x = 2 diff --git a/tests/neg/experimentalEnum.scala b/tests/neg/experimentalEnum.scala index 14ced7ca22bb..1cbe78ca5427 100644 --- a/tests/neg/experimentalEnum.scala +++ b/tests/neg/experimentalEnum.scala @@ -1,5 +1,3 @@ -//> using options -Yno-experimental - import scala.annotation.experimental @experimental diff --git a/tests/neg/experimentalErased.scala b/tests/neg/experimentalErased.scala index 99de8048c261..6fcb11a3cc2f 100644 --- a/tests/neg/experimentalErased.scala +++ b/tests/neg/experimentalErased.scala @@ -1,5 +1,3 @@ -//> using options -Yno-experimental - import language.experimental.erasedDefinitions import annotation.experimental diff --git a/tests/neg/experimentalInline.scala b/tests/neg/experimentalInline.scala index b837ad498492..eb49bf15d11a 100644 --- a/tests/neg/experimentalInline.scala +++ b/tests/neg/experimentalInline.scala @@ -1,5 +1,3 @@ -//> using options -Yno-experimental - import scala.annotation.experimental @experimental diff --git a/tests/neg/experimentalInline2.scala b/tests/neg/experimentalInline2.scala index 8bf6a82fba2e..c40eb050a832 100644 --- a/tests/neg/experimentalInline2.scala +++ b/tests/neg/experimentalInline2.scala @@ -1,5 +1,3 @@ -//> using options -Yno-experimental - import scala.annotation.experimental @experimental diff --git a/tests/neg/experimentalMembers.scala b/tests/neg/experimentalMembers.scala index fe4adbfcf44d..e30f27b069a8 100644 --- a/tests/neg/experimentalMembers.scala +++ b/tests/neg/experimentalMembers.scala @@ -1,5 +1,3 @@ -//> using options -Yno-experimental - import scala.annotation.experimental @experimental def x = 2 diff --git a/tests/neg/experimentalOverride.scala b/tests/neg/experimentalOverride.scala index adc8b919dc6b..653bd3b23da4 100644 --- a/tests/neg/experimentalOverride.scala +++ b/tests/neg/experimentalOverride.scala @@ -1,5 +1,3 @@ -//> using options -Yno-experimental - import scala.annotation.experimental @experimental diff --git a/tests/neg/experimentalRHS.scala b/tests/neg/experimentalRHS.scala index cffa35ed4ba9..27143c120b96 100644 --- a/tests/neg/experimentalRHS.scala +++ b/tests/neg/experimentalRHS.scala @@ -1,5 +1,3 @@ -//> using options -Yno-experimental - import scala.annotation.experimental @experimental diff --git a/tests/neg/experimentalSam.scala b/tests/neg/experimentalSam.scala index ab86cabc6816..cdc9e61858d9 100644 --- a/tests/neg/experimentalSam.scala +++ b/tests/neg/experimentalSam.scala @@ -1,5 +1,3 @@ -//> using options -Yno-experimental - import scala.annotation.experimental @experimental diff --git a/tests/neg/experimentalSignature.scala b/tests/neg/experimentalSignature.scala index 479f9140d0a0..9b1d3c5e999f 100644 --- a/tests/neg/experimentalSignature.scala +++ b/tests/neg/experimentalSignature.scala @@ -1,5 +1,3 @@ -//> using options -Yno-experimental - import scala.annotation.experimental @experimental class A diff --git a/tests/neg/experimentalTerms.scala b/tests/neg/experimentalTerms.scala index 10776e78bae7..ada5e5b74d2c 100644 --- a/tests/neg/experimentalTerms.scala +++ b/tests/neg/experimentalTerms.scala @@ -1,5 +1,3 @@ -//> using options -Yno-experimental - import scala.annotation.experimental @experimental diff --git a/tests/neg/experimentalTests.scala b/tests/neg/experimentalTests.scala index a45809c099c4..f3fbcf8c587c 100644 --- a/tests/neg/experimentalTests.scala +++ b/tests/neg/experimentalTests.scala @@ -1,5 +1,3 @@ -//> using options -Yno-experimental - import scala.annotation.experimental @experimental def x = 2 diff --git a/tests/neg/experimentalType.scala b/tests/neg/experimentalType.scala index 22bdecf415e3..f4013788796a 100644 --- a/tests/neg/experimentalType.scala +++ b/tests/neg/experimentalType.scala @@ -1,5 +1,3 @@ -//> using options -Yno-experimental - import scala.annotation.experimental @experimental diff --git a/tests/neg/experimentalTypeRHS.scala b/tests/neg/experimentalTypeRHS.scala index f5801ea2f11d..3aaeb960bae9 100644 --- a/tests/neg/experimentalTypeRHS.scala +++ b/tests/neg/experimentalTypeRHS.scala @@ -1,5 +1,3 @@ -//> using options -Yno-experimental - import scala.annotation.experimental @experimental type E diff --git a/tests/neg/experimentalTypes2.scala b/tests/neg/experimentalTypes2.scala index 3d042792c4de..706fd39fd15c 100644 --- a/tests/neg/experimentalTypes2.scala +++ b/tests/neg/experimentalTypes2.scala @@ -1,5 +1,3 @@ -//> using options -Yno-experimental - import scala.annotation.experimental @experimental class A diff --git a/tests/neg/experimentalUnapply.scala b/tests/neg/experimentalUnapply.scala index 049577bf63fd..0ba338a15a96 100644 --- a/tests/neg/experimentalUnapply.scala +++ b/tests/neg/experimentalUnapply.scala @@ -1,5 +1,3 @@ -//> using options -Yno-experimental - import scala.annotation.experimental @experimental diff --git a/tests/neg/i13091.scala b/tests/neg/i13091.scala index 208d05d6886d..2b08788ebbc1 100644 --- a/tests/neg/i13091.scala +++ b/tests/neg/i13091.scala @@ -1,5 +1,3 @@ -//> using options -Yno-experimental - import annotation.experimental @experimental class Foo diff --git a/tests/neg/i13848.scala b/tests/neg/i13848.scala index fcc519c47592..886ab1e85d67 100644 --- a/tests/neg/i13848.scala +++ b/tests/neg/i13848.scala @@ -1,5 +1,3 @@ -//> using options -Yno-experimental - import annotation.experimental @main diff --git a/tests/neg/i17292.scala b/tests/neg/i17292.scala index 9cf7fc7b1c30..381d252dbea8 100644 --- a/tests/neg/i17292.scala +++ b/tests/neg/i17292.scala @@ -1,5 +1,3 @@ -//> using options -Yno-experimental - import annotation.experimental class Foo { @experimental type Bar = (Int, String) } diff --git a/tests/neg/i17292b.scala b/tests/neg/i17292b.scala index b89a64439699..f644dd60ecd5 100644 --- a/tests/neg/i17292b.scala +++ b/tests/neg/i17292b.scala @@ -1,5 +1,3 @@ -//> using options -Yno-experimental - import annotation.experimental type A[T] = Int class Foo { diff --git a/tests/neg/i2642.scala b/tests/neg/i2642.scala index b9cde8b1b450..59bb3a805449 100644 --- a/tests/neg/i2642.scala +++ b/tests/neg/i2642.scala @@ -1,4 +1,4 @@ -//> using options -language:experimental.erasedDefinitions +//> using options -experimental -language:experimental.erasedDefinitions object Foo { type X = (using ) => Int // error: an identifier expected, but ')' found diff --git a/tests/neg/i2771.scala b/tests/neg/i2771.scala index b6e15f4dc663..1d013b82b06f 100644 --- a/tests/neg/i2771.scala +++ b/tests/neg/i2771.scala @@ -1,3 +1,5 @@ +//> using options -experimental + import language.experimental.namedTypeArguments trait A { type L[X] } trait B { type L } diff --git a/tests/neg/i4060.scala b/tests/neg/i4060.scala index ba641d633d3c..c09594a1bcea 100644 --- a/tests/neg/i4060.scala +++ b/tests/neg/i4060.scala @@ -1,4 +1,4 @@ -//> using options -language:experimental.erasedDefinitions +//> using options -experimental -language:experimental.erasedDefinitions // See https://github.com/lampepfl/dotty/issues/4060#issuecomment-445808377 diff --git a/tests/neg/i5525b.scala b/tests/neg/i5525b.scala index d51564ad52c1..43a6da904434 100644 --- a/tests/neg/i5525b.scala +++ b/tests/neg/i5525b.scala @@ -1,4 +1,4 @@ -//> using options -language:experimental.erasedDefinitions +//> using options -experimental -language:experimental.erasedDefinitions erased enum Foo6 {} // error: only access modifiers allowed diff --git a/tests/neg/interleaving-signatureCollision.scala b/tests/neg/interleaving-signatureCollision.scala index a6a729ed3b62..fa7a333a56c8 100644 --- a/tests/neg/interleaving-signatureCollision.scala +++ b/tests/neg/interleaving-signatureCollision.scala @@ -1,3 +1,5 @@ +//> using options -experimental + import scala.language.experimental.clauseInterleaving object signatureCollision: diff --git a/tests/neg/interleaving-typeApply.check b/tests/neg/interleaving-typeApply.check index a50c1455bfbb..b73535b78184 100644 --- a/tests/neg/interleaving-typeApply.check +++ b/tests/neg/interleaving-typeApply.check @@ -1,29 +1,29 @@ --- [E057] Type Mismatch Error: tests/neg/interleaving-typeApply.scala:10:11 -------------------------------------------- -10 | f3[String]() // error +-- [E057] Type Mismatch Error: tests/neg/interleaving-typeApply.scala:12:11 -------------------------------------------- +12 | f3[String]() // error | ^ | Type argument String does not conform to upper bound Int | | longer explanation available when compiling with `-explain` --- [E057] Type Mismatch Error: tests/neg/interleaving-typeApply.scala:11:16 -------------------------------------------- -11 | f5[Int][Unit] // error +-- [E057] Type Mismatch Error: tests/neg/interleaving-typeApply.scala:13:16 -------------------------------------------- +13 | f5[Int][Unit] // error | ^ | Type argument Unit does not conform to upper bound String | | longer explanation available when compiling with `-explain` --- [E057] Type Mismatch Error: tests/neg/interleaving-typeApply.scala:12:19 -------------------------------------------- -12 | f5[String][Unit] // error // error +-- [E057] Type Mismatch Error: tests/neg/interleaving-typeApply.scala:14:19 -------------------------------------------- +14 | f5[String][Unit] // error // error | ^ | Type argument Unit does not conform to upper bound String | | longer explanation available when compiling with `-explain` --- [E057] Type Mismatch Error: tests/neg/interleaving-typeApply.scala:12:11 -------------------------------------------- -12 | f5[String][Unit] // error // error +-- [E057] Type Mismatch Error: tests/neg/interleaving-typeApply.scala:14:11 -------------------------------------------- +14 | f5[String][Unit] // error // error | ^ | Type argument String does not conform to upper bound Int | | longer explanation available when compiling with `-explain` --- [E057] Type Mismatch Error: tests/neg/interleaving-typeApply.scala:13:11 -------------------------------------------- -13 | f7[String]()[Unit] // error +-- [E057] Type Mismatch Error: tests/neg/interleaving-typeApply.scala:15:11 -------------------------------------------- +15 | f7[String]()[Unit] // error | ^ | Type argument String does not conform to upper bound Int | diff --git a/tests/neg/interleaving-typeApply.scala b/tests/neg/interleaving-typeApply.scala index ad21fe2f0329..ff7464179557 100644 --- a/tests/neg/interleaving-typeApply.scala +++ b/tests/neg/interleaving-typeApply.scala @@ -1,7 +1,9 @@ +//> using options -experimental + import scala.language.experimental.clauseInterleaving object typeApply: - + def f3[T <: Int](using DummyImplicit)[U <: String](): T => T = ??? def f5[T <: Int](using DummyImplicit)[U <: String]: [X <: Unit] => X => X = ??? def f7[T <: Int](using DummyImplicit)[U <: String]()[X <: Unit]: X => X = ??? diff --git a/tests/neg/lambda-infer.scala b/tests/neg/lambda-infer.scala index 90f40aa05e86..85abdacb85e4 100644 --- a/tests/neg/lambda-infer.scala +++ b/tests/neg/lambda-infer.scala @@ -1,4 +1,4 @@ -//> using options -language:experimental.erasedDefinitions +//> using options -experimental -language:experimental.erasedDefinitions type F = (Int, erased Int) => Int diff --git a/tests/neg/multiple-args-consume.scala b/tests/neg/multiple-args-consume.scala index 6966eb0a3280..07399fcbe393 100644 --- a/tests/neg/multiple-args-consume.scala +++ b/tests/neg/multiple-args-consume.scala @@ -1,4 +1,4 @@ -//> using options -language:experimental.erasedDefinitions +//> using options -experimental -language:experimental.erasedDefinitions def foo(erased x: Int, y: Int) = y def bar(x: Int, erased y: Int) = x diff --git a/tests/neg/multiple-args.scala b/tests/neg/multiple-args.scala index 0349e956a6a8..25255dd920c1 100644 --- a/tests/neg/multiple-args.scala +++ b/tests/neg/multiple-args.scala @@ -1,4 +1,4 @@ -//> using options -language:experimental.erasedDefinitions +//> using options -experimental -language:experimental.erasedDefinitions def foo(x: Int, erased y: Int): Int = x def bar(erased x: Int, y: Int): Int = y diff --git a/tests/neg/overrides.scala b/tests/neg/overrides.scala index ff83b91d26be..8016f5646d09 100644 --- a/tests/neg/overrides.scala +++ b/tests/neg/overrides.scala @@ -1,3 +1,5 @@ +//> using options -experimental + class Foo { type A = Int type B >: Int <: Int diff --git a/tests/neg/polymorphic-erased-functions-used.check b/tests/neg/polymorphic-erased-functions-used.check index 6eb5abb0e235..bf1004ae6522 100644 --- a/tests/neg/polymorphic-erased-functions-used.check +++ b/tests/neg/polymorphic-erased-functions-used.check @@ -1,8 +1,8 @@ --- Error: tests/neg/polymorphic-erased-functions-used.scala:3:33 ------------------------------------------------------- -3 |def t1 = [T] => (erased t: T) => t // error +-- Error: tests/neg/polymorphic-erased-functions-used.scala:5:33 ------------------------------------------------------- +5 |def t1 = [T] => (erased t: T) => t // error | ^ | parameter t is declared as `erased`, but is in fact used --- Error: tests/neg/polymorphic-erased-functions-used.scala:4:42 ------------------------------------------------------- -4 |def t2 = [T, U] => (t: T, erased u: U) => u // error +-- Error: tests/neg/polymorphic-erased-functions-used.scala:6:42 ------------------------------------------------------- +6 |def t2 = [T, U] => (t: T, erased u: U) => u // error | ^ | parameter u is declared as `erased`, but is in fact used diff --git a/tests/neg/sip-53-exprimental-a.scala b/tests/neg/sip-53-exprimental-a.scala index 1b2f5a24d8a9..33710d76d3ae 100644 --- a/tests/neg/sip-53-exprimental-a.scala +++ b/tests/neg/sip-53-exprimental-a.scala @@ -1,5 +1,3 @@ -//> using options -Yno-experimental - import scala.quoted.* def foo(using Quotes): Unit = diff --git a/tests/neg/sip-53-exprimental-b.scala b/tests/neg/sip-53-exprimental-b.scala index 0fb391c9cb5f..2ec597995bd1 100644 --- a/tests/neg/sip-53-exprimental-b.scala +++ b/tests/neg/sip-53-exprimental-b.scala @@ -1,5 +1,3 @@ -//> using options -Yno-experimental - import scala.quoted.* def empty[K <: AnyKind : Type](using Quotes): Type[?] = diff --git a/tests/neg/tupled-function-instances-2.scala b/tests/neg/tupled-function-instances-2.scala index 1abd3f3a3f54..700a47a4be8b 100644 --- a/tests/neg/tupled-function-instances-2.scala +++ b/tests/neg/tupled-function-instances-2.scala @@ -1,4 +1,4 @@ -//> using options -language:experimental.erasedDefinitions +//> using options -experimental -language:experimental.erasedDefinitions import scala.util.TupledFunction object Test { diff --git a/tests/neg/typeclass-derivation2.scala b/tests/neg/typeclass-derivation2.scala index eca11fb326ed..27c2794d7aa2 100644 --- a/tests/neg/typeclass-derivation2.scala +++ b/tests/neg/typeclass-derivation2.scala @@ -1,4 +1,4 @@ -//> using options -language:experimental.erasedDefinitions +//> using options -experimental -language:experimental.erasedDefinitions import scala.collection.mutable import scala.annotation.tailrec diff --git a/tests/pos/erased-class-separate/A_1.scala b/tests/pos-custom-args/erased/erased-class-separate/A_1.scala similarity index 100% rename from tests/pos/erased-class-separate/A_1.scala rename to tests/pos-custom-args/erased/erased-class-separate/A_1.scala diff --git a/tests/pos/erased-class-separate/Test_2.scala b/tests/pos-custom-args/erased/erased-class-separate/Test_2.scala similarity index 100% rename from tests/pos/erased-class-separate/Test_2.scala rename to tests/pos-custom-args/erased/erased-class-separate/Test_2.scala diff --git a/tests/pos/erased-conforms.scala b/tests/pos-custom-args/erased/erased-conforms.scala similarity index 100% rename from tests/pos/erased-conforms.scala rename to tests/pos-custom-args/erased/erased-conforms.scala diff --git a/tests/pos-macros/erasedArgs/Macro_1.scala b/tests/pos-custom-args/erased/erasedArgs/Macro_1.scala similarity index 100% rename from tests/pos-macros/erasedArgs/Macro_1.scala rename to tests/pos-custom-args/erased/erasedArgs/Macro_1.scala diff --git a/tests/pos-macros/erasedArgs/Test_2.scala b/tests/pos-custom-args/erased/erasedArgs/Test_2.scala similarity index 100% rename from tests/pos-macros/erasedArgs/Test_2.scala rename to tests/pos-custom-args/erased/erasedArgs/Test_2.scala diff --git a/tests/pos/i11743.scala b/tests/pos-custom-args/erased/i11743.scala similarity index 100% rename from tests/pos/i11743.scala rename to tests/pos-custom-args/erased/i11743.scala diff --git a/tests/pos/i11864.scala b/tests/pos-custom-args/erased/i11864.scala similarity index 100% rename from tests/pos/i11864.scala rename to tests/pos-custom-args/erased/i11864.scala diff --git a/tests/pos/i11896.scala b/tests/pos-custom-args/erased/i11896.scala similarity index 100% rename from tests/pos/i11896.scala rename to tests/pos-custom-args/erased/i11896.scala diff --git a/tests/pos/i13392.scala b/tests/pos-custom-args/erased/i13392.scala similarity index 100% rename from tests/pos/i13392.scala rename to tests/pos-custom-args/erased/i13392.scala diff --git a/tests/pos/i17584a.scala b/tests/pos-custom-args/erased/i17584a.scala similarity index 99% rename from tests/pos/i17584a.scala rename to tests/pos-custom-args/erased/i17584a.scala index 6bed4d935831..d0d850c6119d 100644 --- a/tests/pos/i17584a.scala +++ b/tests/pos-custom-args/erased/i17584a.scala @@ -1,4 +1,3 @@ - import language.experimental.erasedDefinitions trait A: erased def g = 1 diff --git a/tests/pos/poly-erased-functions.scala b/tests/pos-custom-args/erased/poly-erased-functions.scala similarity index 100% rename from tests/pos/poly-erased-functions.scala rename to tests/pos-custom-args/erased/poly-erased-functions.scala diff --git a/tests/pos-macros/annot-in-object/Test_2.scala b/tests/pos-macros/annot-in-object/Test_2.scala index 4fc43d4f2e41..382685873adb 100644 --- a/tests/pos-macros/annot-in-object/Test_2.scala +++ b/tests/pos-macros/annot-in-object/Test_2.scala @@ -1,3 +1,5 @@ +//> using options -experimental + @Foo.void @Foo.Bar.void def test = 0 diff --git a/tests/pos-macros/annot-suspend/Test_2.scala b/tests/pos-macros/annot-suspend/Test_2.scala index ee8529fa4414..4fdbcf919373 100644 --- a/tests/pos-macros/annot-suspend/Test_2.scala +++ b/tests/pos-macros/annot-suspend/Test_2.scala @@ -1,2 +1,4 @@ +//> using options -experimental + @void def test = 0 diff --git a/tests/pos-macros/annot-then-inline/Test_2.scala b/tests/pos-macros/annot-then-inline/Test_2.scala index 3e72fcaaae1d..1798fde62676 100644 --- a/tests/pos-macros/annot-then-inline/Test_2.scala +++ b/tests/pos-macros/annot-then-inline/Test_2.scala @@ -1,2 +1,4 @@ +//> using options -experimental + @useInlinedIdentity def test = 0 diff --git a/tests/pos-macros/i10864/Macro_1.scala b/tests/pos-macros/i10864/Macro_1.scala index 7cf1e1850a76..aedd14fa68fc 100644 --- a/tests/pos-macros/i10864/Macro_1.scala +++ b/tests/pos-macros/i10864/Macro_1.scala @@ -1,3 +1,5 @@ +//> using options -experimental + import scala.quoted._ case class T(t: Type[_]) diff --git a/tests/pos-macros/i10864/Test_2.scala b/tests/pos-macros/i10864/Test_2.scala index e93fa1302221..af45ece6d5a4 100644 --- a/tests/pos-macros/i10864/Test_2.scala +++ b/tests/pos-macros/i10864/Test_2.scala @@ -1,3 +1,5 @@ +//> using options -experimental + def test = T.run[List] T.run[Map] diff --git a/tests/pos-macros/i10864a/Macro_1.scala b/tests/pos-macros/i10864a/Macro_1.scala index d1d5302544b4..caca8dccf024 100644 --- a/tests/pos-macros/i10864a/Macro_1.scala +++ b/tests/pos-macros/i10864a/Macro_1.scala @@ -1,3 +1,5 @@ +//> using options -experimental + import scala.quoted._ case class T(t: Type[_]) diff --git a/tests/pos-macros/i10864a/Test_2.scala b/tests/pos-macros/i10864a/Test_2.scala index 7a1596d0fa41..713104affe23 100644 --- a/tests/pos-macros/i10864a/Test_2.scala +++ b/tests/pos-macros/i10864a/Test_2.scala @@ -1,3 +1,5 @@ +//> using options -experimental + @main def run = T.run[Int] diff --git a/tests/pos-macros/i11738.scala b/tests/pos-macros/i11738.scala index e1213a5dee6d..f65e37303cdf 100644 --- a/tests/pos-macros/i11738.scala +++ b/tests/pos-macros/i11738.scala @@ -1,3 +1,5 @@ +//> using options -experimental + import scala.quoted.* def blah[A](using Quotes, Type[A]): Expr[Unit] = diff --git a/tests/pos-macros/i16522.scala b/tests/pos-macros/i16522.scala index 0a94931ec1a7..b8f89fa4a9db 100644 --- a/tests/pos-macros/i16522.scala +++ b/tests/pos-macros/i16522.scala @@ -1,3 +1,5 @@ +//> using options -experimental + import scala.quoted.* sealed trait HList diff --git a/tests/pos-macros/i18125.scala b/tests/pos-macros/i18125.scala index 8c5504cafacc..bd8fb476f005 100644 --- a/tests/pos-macros/i18125.scala +++ b/tests/pos-macros/i18125.scala @@ -1,3 +1,5 @@ +//> using options -experimental + import scala.quoted.* final class Foo[T](ns: T) diff --git a/tests/pos-macros/i7264.scala b/tests/pos-macros/i7264.scala index 82264402c768..2bb20569f3d9 100644 --- a/tests/pos-macros/i7264.scala +++ b/tests/pos-macros/i7264.scala @@ -1,3 +1,5 @@ +//> using options -experimental + import scala.quoted.* class Foo { def f[T2](t: Type[T2])(using Quotes) = t match { diff --git a/tests/pos-macros/mirrorQuotePattern.scala b/tests/pos-macros/mirrorQuotePattern.scala index 1b3b77591339..b79839f3d139 100644 --- a/tests/pos-macros/mirrorQuotePattern.scala +++ b/tests/pos-macros/mirrorQuotePattern.scala @@ -1,3 +1,5 @@ +//> using options -experimental + import scala.deriving._ import scala.quoted._ diff --git a/tests/pos-macros/mirrorQuotePattern2.scala b/tests/pos-macros/mirrorQuotePattern2.scala index a123cc28907f..611343dbfffa 100644 --- a/tests/pos-macros/mirrorQuotePattern2.scala +++ b/tests/pos-macros/mirrorQuotePattern2.scala @@ -1,3 +1,5 @@ +//> using options -experimental + import scala.deriving._ import scala.quoted._ diff --git a/tests/pos-macros/multiline-quote-patterns.scala b/tests/pos-macros/multiline-quote-patterns.scala index a1f1649b6059..872016702975 100644 --- a/tests/pos-macros/multiline-quote-patterns.scala +++ b/tests/pos-macros/multiline-quote-patterns.scala @@ -1,3 +1,5 @@ +//> using options -experimental + import scala.quoted.* def types(t: Type[?])(using Quotes) = t match { case '[ diff --git a/tests/pos-macros/quote-pattern-type-variable-no-escape.scala b/tests/pos-macros/quote-pattern-type-variable-no-escape.scala index 06a53b68e793..2c020236f906 100644 --- a/tests/pos-macros/quote-pattern-type-variable-no-escape.scala +++ b/tests/pos-macros/quote-pattern-type-variable-no-escape.scala @@ -1,3 +1,5 @@ +//> using options -experimental + import scala.quoted.* def foo[T: Type](expr: Expr[Any])(using Quotes): Any = diff --git a/tests/pos/caps-universal.scala b/tests/pos/caps-universal.scala index 014955caaa87..20225f30ed6f 100644 --- a/tests/pos/caps-universal.scala +++ b/tests/pos/caps-universal.scala @@ -1,10 +1,8 @@ +//> using options -experimental + import language.experimental.pureFunctions import annotation.retains val id: Int -> Int = (x: Int) => x val foo: Int => Int = id val bar: (Int -> Int) @retains(caps.*) = foo - - - - diff --git a/tests/pos/cc-experimental.scala b/tests/pos/cc-experimental.scala index 4ee1f6732356..c4c1754fa21c 100644 --- a/tests/pos/cc-experimental.scala +++ b/tests/pos/cc-experimental.scala @@ -1,5 +1,3 @@ -//> using options -Yno-experimental - package scala.runtime import language.experimental.captureChecking diff --git a/tests/pos/dotty-experimental.scala b/tests/pos/dotty-experimental.scala index 9cffddc0b8ba..114b1d5b0c83 100644 --- a/tests/pos/dotty-experimental.scala +++ b/tests/pos/dotty-experimental.scala @@ -1,5 +1,3 @@ -//> using options -Yno-experimental - import language.experimental.captureChecking object test { diff --git a/tests/pos/erased-args-lifted.scala b/tests/pos/erased-args-lifted.scala index cf68e17dfbbb..572774e97420 100644 --- a/tests/pos/erased-args-lifted.scala +++ b/tests/pos/erased-args-lifted.scala @@ -1,4 +1,4 @@ -//> using options -language:experimental.erasedDefinitions +//> using options -experimental -language:experimental.erasedDefinitions object Test { def foo(erased a: Int)(b: Int, c: Int) = 42 diff --git a/tests/pos/erased-asInstanceOf.scala b/tests/pos/erased-asInstanceOf.scala index 692ff3a16b05..04eda3b09827 100644 --- a/tests/pos/erased-asInstanceOf.scala +++ b/tests/pos/erased-asInstanceOf.scala @@ -1,4 +1,4 @@ -//> using options -language:experimental.erasedDefinitions +//> using options -experimental -language:experimental.erasedDefinitions trait Dataset { def select(erased c: Column): Unit = () diff --git a/tests/pos/erased-class-as-args.scala b/tests/pos/erased-class-as-args.scala index 128cd2b818e4..51f7e6be5688 100644 --- a/tests/pos/erased-class-as-args.scala +++ b/tests/pos/erased-class-as-args.scala @@ -1,4 +1,4 @@ -//> using options -language:experimental.erasedDefinitions +//> using options -experimental -language:experimental.erasedDefinitions erased class A diff --git a/tests/pos/erased-deep-context.scala b/tests/pos/erased-deep-context.scala index 2303feec5747..3982124a58de 100644 --- a/tests/pos/erased-deep-context.scala +++ b/tests/pos/erased-deep-context.scala @@ -1,4 +1,4 @@ -//> using options -language:experimental.erasedDefinitions +//> using options -experimental -language:experimental.erasedDefinitions object Test { def outer1(): Int = { diff --git a/tests/pos/erased-extension-method.scala b/tests/pos/erased-extension-method.scala index f0d5f502334c..9c7bb74af7e7 100644 --- a/tests/pos/erased-extension-method.scala +++ b/tests/pos/erased-extension-method.scala @@ -1,4 +1,4 @@ -//> using options -language:experimental.erasedDefinitions +//> using options -experimental -language:experimental.erasedDefinitions class IntDeco(x: Int) extends AnyVal { def foo(erased y: Int) = x diff --git a/tests/pos/erased-lub-2.scala b/tests/pos/erased-lub-2.scala index 383275341904..70face0a303e 100644 --- a/tests/pos/erased-lub-2.scala +++ b/tests/pos/erased-lub-2.scala @@ -1,4 +1,4 @@ -//> using options -language:experimental.erasedDefinitions +//> using options -experimental -language:experimental.erasedDefinitions trait Foo diff --git a/tests/pos/erased-lub.scala b/tests/pos/erased-lub.scala index 06ee25be79e1..cf7526b1d8d9 100644 --- a/tests/pos/erased-lub.scala +++ b/tests/pos/erased-lub.scala @@ -1,4 +1,4 @@ -//> using options -language:experimental.erasedDefinitions +//> using options -experimental -language:experimental.erasedDefinitions // Verify that expressions below perform correct boxings in erasure. object Test { diff --git a/tests/pos/erased-soft-keyword.scala b/tests/pos/erased-soft-keyword.scala index fdcc6d85ebd0..0372af8701c4 100644 --- a/tests/pos/erased-soft-keyword.scala +++ b/tests/pos/erased-soft-keyword.scala @@ -1,4 +1,4 @@ -//> using options -language:experimental.erasedDefinitions +//> using options -experimental -language:experimental.erasedDefinitions def f1(x: Int, erased y: Int) = 0 def f2(x: Int, erased: Int) = 0 diff --git a/tests/pos/erased-typedef.scala b/tests/pos/erased-typedef.scala index bd0e012e6e6c..57cb1debe37a 100644 --- a/tests/pos/erased-typedef.scala +++ b/tests/pos/erased-typedef.scala @@ -1,4 +1,4 @@ -//> using options -language:experimental.erasedDefinitions +//> using options -experimental -language:experimental.erasedDefinitions trait Monadless[Monad[_]] { diff --git a/tests/pos/expeimental-flag-with-lang-feature.scala b/tests/pos/expeimental-flag-with-lang-feature.scala new file mode 100644 index 000000000000..96069c332e02 --- /dev/null +++ b/tests/pos/expeimental-flag-with-lang-feature.scala @@ -0,0 +1,10 @@ +//> using options -experimental + +import scala.language.experimental.erasedDefinitions +import scala.language.experimental.namedTypeArguments + +erased def erasedFun(erased x: Int): Int = x + +def namedTypeArgumentsFun[T, U]: Int = + namedTypeArgumentsFun[T = Int, U = Int] + namedTypeArgumentsFun[U = Int, T = Int] diff --git a/tests/pos/expeimental-flag.scala b/tests/pos/expeimental-flag.scala new file mode 100644 index 000000000000..e5d6274c4c80 --- /dev/null +++ b/tests/pos/expeimental-flag.scala @@ -0,0 +1,18 @@ +//> using options -experimental + +import scala.annotation.experimental + +class Foo: + def foo: Int = experimentalDef + +class Bar: + def bar: Int = experimentalDef +object Bar: + def bar: Int = experimentalDef + +object Baz: + def bar: Int = experimentalDef + +def toplevelMethod: Int = experimentalDef + +@experimental def experimentalDef: Int = 1 diff --git a/tests/pos/experimental-imports-empty.scala b/tests/pos/experimental-imports-empty.scala index 18d83839e7e7..998086c5d9a4 100644 --- a/tests/pos/experimental-imports-empty.scala +++ b/tests/pos/experimental-imports-empty.scala @@ -1,5 +1,3 @@ -//> using options -Yno-experimental - import annotation.experimental import language.experimental.namedTypeArguments import language.experimental.genericNumberLiterals diff --git a/tests/pos/experimental-imports-top.scala b/tests/pos/experimental-imports-top.scala index 16f44e48eb32..bee89d6ab6c8 100644 --- a/tests/pos/experimental-imports-top.scala +++ b/tests/pos/experimental-imports-top.scala @@ -1,5 +1,3 @@ -//> using options -Yno-experimental - import language.experimental.erasedDefinitions import annotation.experimental diff --git a/tests/pos/experimentalErased-2.scala b/tests/pos/experimentalErased-2.scala new file mode 100644 index 000000000000..0eb61895f3e5 --- /dev/null +++ b/tests/pos/experimentalErased-2.scala @@ -0,0 +1,12 @@ +//> using options -experimental + +import language.experimental.erasedDefinitions +import annotation.experimental + +erased class Bar + +erased def bar = 2 + +erased val bar2 = 2 + +def bar3(erased a: Int) = 2 diff --git a/tests/pos/experimentalErased.scala b/tests/pos/experimentalErased.scala index 358c134c714a..f77c7f2a8a15 100644 --- a/tests/pos/experimentalErased.scala +++ b/tests/pos/experimentalErased.scala @@ -4,19 +4,11 @@ import annotation.experimental @experimental erased class Foo -erased class Bar - @experimental erased def foo = 2 -erased def bar = 2 - @experimental erased val foo2 = 2 -erased val bar2 = 2 - @experimental def foo3(erased a: Int) = 2 - -def bar3(erased a: Int) = 2 diff --git a/tests/pos/gadt-GadtStlc.scala b/tests/pos/gadt-GadtStlc.scala index d3a645486a33..99a10d0bd2c2 100644 --- a/tests/pos/gadt-GadtStlc.scala +++ b/tests/pos/gadt-GadtStlc.scala @@ -1,3 +1,5 @@ +//> using options -experimental + import language.experimental.namedTypeArguments object GadtStlc { // creates type-level "strings" like M[M[M[W]]] diff --git a/tests/pos/gadt-TypeSafeLambda.scala b/tests/pos/gadt-TypeSafeLambda.scala index ae3a53448ded..b6b127ea9028 100644 --- a/tests/pos/gadt-TypeSafeLambda.scala +++ b/tests/pos/gadt-TypeSafeLambda.scala @@ -1,3 +1,5 @@ +//> using options -experimental + import language.experimental.namedTypeArguments object TypeSafeLambda { diff --git a/tests/pos/i10848a.scala b/tests/pos/i10848a.scala index 434cf716c930..e6cf47b68deb 100644 --- a/tests/pos/i10848a.scala +++ b/tests/pos/i10848a.scala @@ -1,4 +1,4 @@ -//> using options -language:experimental.erasedDefinitions +//> using options -experimental -language:experimental.erasedDefinitions class IsOn[T] type On diff --git a/tests/pos/i10848b.scala b/tests/pos/i10848b.scala index bff74663c359..d0c5e3355edf 100644 --- a/tests/pos/i10848b.scala +++ b/tests/pos/i10848b.scala @@ -1,4 +1,4 @@ -//> using options -language:experimental.erasedDefinitions +//> using options -experimental -language:experimental.erasedDefinitions class Foo: erased given Int = 1 diff --git a/tests/pos/i13091.scala b/tests/pos/i13091.scala index fa255cd6c08f..e4f4656262cb 100644 --- a/tests/pos/i13091.scala +++ b/tests/pos/i13091.scala @@ -1,3 +1,5 @@ +//> using options -experimental + import annotation.experimental @experimental class Foo val foo = new Foo diff --git a/tests/pos/i13558.scala b/tests/pos/i13558.scala index 0c8be379f6a9..bef55cfdb3c8 100644 --- a/tests/pos/i13558.scala +++ b/tests/pos/i13558.scala @@ -1,3 +1,5 @@ +//> using options -experimental + package testcode import language.experimental.relaxedExtensionImports diff --git a/tests/pos/i13816.scala b/tests/pos/i13816.scala index a87be4803936..0e3daef278c2 100644 --- a/tests/pos/i13816.scala +++ b/tests/pos/i13816.scala @@ -1,3 +1,5 @@ +//> using options -experimental + import language.experimental.saferExceptions class Ex1 extends Exception("Ex1") diff --git a/tests/pos/i13848.scala b/tests/pos/i13848.scala index 266f3edcf7ae..8b65ccb078e1 100644 --- a/tests/pos/i13848.scala +++ b/tests/pos/i13848.scala @@ -1,5 +1,3 @@ -//> using options -Yno-experimental - import annotation.experimental @main diff --git a/tests/pos/i15133a.scala b/tests/pos/i15133a.scala index 1aff3a5c1cfc..c7f55f7838c7 100644 --- a/tests/pos/i15133a.scala +++ b/tests/pos/i15133a.scala @@ -1,5 +1,3 @@ -//> using options -Yno-experimental - import scala.annotation.experimental @experimental diff --git a/tests/pos/i15133b.scala b/tests/pos/i15133b.scala index 4c235d37c698..d14d6e84cf6e 100644 --- a/tests/pos/i15133b.scala +++ b/tests/pos/i15133b.scala @@ -1,5 +1,3 @@ -//> using options -Yno-experimental - import scala.annotation.experimental @experimental diff --git a/tests/pos/i16091.scala b/tests/pos/i16091.scala index 349e16e6d7e6..0324aeacccc9 100644 --- a/tests/pos/i16091.scala +++ b/tests/pos/i16091.scala @@ -1,5 +1,3 @@ -//> using options -Yno-experimental - import scala.annotation.experimental object Macro { diff --git a/tests/pos/i16920.scala b/tests/pos/i16920.scala index dd4f5804a4fd..356f29ed7815 100644 --- a/tests/pos/i16920.scala +++ b/tests/pos/i16920.scala @@ -1,3 +1,5 @@ +//> using options -experimental + import language.experimental.relaxedExtensionImports object One: diff --git a/tests/pos/i3666-gadt.scala b/tests/pos/i3666-gadt.scala index 382019660e3d..bd50ed22eee1 100644 --- a/tests/pos/i3666-gadt.scala +++ b/tests/pos/i3666-gadt.scala @@ -1,3 +1,5 @@ +//> using options -experimental + import language.experimental.namedTypeArguments object i3666 { sealed trait Exp[T] diff --git a/tests/pos/i3955.scala b/tests/pos/i3955.scala index 79e67bacb0af..fd5c50f66e6a 100644 --- a/tests/pos/i3955.scala +++ b/tests/pos/i3955.scala @@ -1,3 +1,5 @@ +//> using options -experimental + import language.experimental.namedTypeArguments object Foo { inline def f[S, T](x: S): T = ??? diff --git a/tests/pos/i5328.scala b/tests/pos/i5328.scala index f6f2a89dbe81..bc24c71c2607 100644 --- a/tests/pos/i5328.scala +++ b/tests/pos/i5328.scala @@ -1,3 +1,5 @@ +//> using options -experimental + import language.experimental.namedTypeArguments class C[X, Y] { def apply[Z](x: X, y: Y, z: Z) = (x, y, z) } diff --git a/tests/pos/i7851.scala b/tests/pos/i7851.scala index 7be04c45a257..16d28ad353f9 100644 --- a/tests/pos/i7851.scala +++ b/tests/pos/i7851.scala @@ -1,3 +1,5 @@ +//> using options -experimental + trait Wrappable[T] { } given Wrappable[Float] with { } diff --git a/tests/pos/i7868.scala b/tests/pos/i7868.scala index f4d7da6acb5b..c495d20508d5 100644 --- a/tests/pos/i7868.scala +++ b/tests/pos/i7868.scala @@ -1,4 +1,4 @@ -//> using options -language:experimental.erasedDefinitions +//> using options -experimental -language:experimental.erasedDefinitions import language.experimental.namedTypeArguments import scala.compiletime.* diff --git a/tests/pos/i7878.scala b/tests/pos/i7878.scala index 05a1b6093e6a..fe92ea2ee600 100644 --- a/tests/pos/i7878.scala +++ b/tests/pos/i7878.scala @@ -1,4 +1,4 @@ -//> using options -language:experimental.erasedDefinitions +//> using options -experimental -language:experimental.erasedDefinitions object Boom { import scala.compiletime.* diff --git a/tests/pos/i8945.scala b/tests/pos/i8945.scala index 2ae8fc268cbf..5dded16f0160 100644 --- a/tests/pos/i8945.scala +++ b/tests/pos/i8945.scala @@ -1,5 +1,3 @@ -//> using options -Yno-experimental - // src-2/MacroImpl.scala trait Context { object universe { diff --git a/tests/pos/interleaving-ba.scala b/tests/pos/interleaving-ba.scala index 69fe2d9537a0..2f61f4f41433 100644 --- a/tests/pos/interleaving-ba.scala +++ b/tests/pos/interleaving-ba.scala @@ -1,3 +1,5 @@ +//> using options -experimental + import scala.language.experimental.clauseInterleaving object BA { diff --git a/tests/pos/interleaving-chainedParams.scala b/tests/pos/interleaving-chainedParams.scala index e502888d97c8..d30a5346e03e 100644 --- a/tests/pos/interleaving-chainedParams.scala +++ b/tests/pos/interleaving-chainedParams.scala @@ -1,3 +1,5 @@ +//> using options -experimental + import scala.language.experimental.clauseInterleaving object chainedParams{ @@ -5,7 +7,7 @@ object chainedParams{ trait Chain{ type Tail <: Chain } - + def f[C1 <: Chain](c1: C1)[C2 <: c1.Tail](c2: C2)[C3 <: c2.Tail](c3: C3): c3.Tail = ??? val self = new Chain{ type Tail = this.type } diff --git a/tests/pos/interleaving-classless.scala b/tests/pos/interleaving-classless.scala index 5aec92db3409..54171684d8df 100644 --- a/tests/pos/interleaving-classless.scala +++ b/tests/pos/interleaving-classless.scala @@ -1,3 +1,5 @@ +//> using options -experimental + import scala.language.experimental.clauseInterleaving def f1[T]()[U](x: T, y: U): (T, U) = (x, y) diff --git a/tests/pos/interleaving-functor.scala b/tests/pos/interleaving-functor.scala index 35bed59f77f0..04c1aa00b3d7 100644 --- a/tests/pos/interleaving-functor.scala +++ b/tests/pos/interleaving-functor.scala @@ -1,3 +1,5 @@ +//> using options -experimental + import scala.language.experimental.clauseInterleaving object functorInterleaving: diff --git a/tests/pos/interleaving-newline.scala b/tests/pos/interleaving-newline.scala index de8fb98a2f81..48b9365a24c7 100644 --- a/tests/pos/interleaving-newline.scala +++ b/tests/pos/interleaving-newline.scala @@ -1,3 +1,5 @@ +//> using options -experimental + import scala.language.experimental.clauseInterleaving object newline { diff --git a/tests/pos/interleaving-overload.scala b/tests/pos/interleaving-overload.scala index 1902551f9036..8956d7e3e4ad 100644 --- a/tests/pos/interleaving-overload.scala +++ b/tests/pos/interleaving-overload.scala @@ -1,3 +1,5 @@ +//> using options -experimental + import scala.language.experimental.clauseInterleaving class A{ diff --git a/tests/pos/interleaving-params.scala b/tests/pos/interleaving-params.scala index 36963ff2e123..67735aae6e18 100644 --- a/tests/pos/interleaving-params.scala +++ b/tests/pos/interleaving-params.scala @@ -1,3 +1,5 @@ +//> using options -experimental + import scala.language.experimental.clauseInterleaving class Params{ diff --git a/tests/pos/interleaving-signatureCollision.scala b/tests/pos/interleaving-signatureCollision.scala index 77190284ae6d..d8ee08dfae09 100644 --- a/tests/pos/interleaving-signatureCollision.scala +++ b/tests/pos/interleaving-signatureCollision.scala @@ -1,3 +1,5 @@ +//> using options -experimental + import scala.language.experimental.clauseInterleaving import scala.annotation.targetName diff --git a/tests/pos/interleaving-typeApply.scala b/tests/pos/interleaving-typeApply.scala index 3c669cc76bfc..f22140ae25a2 100644 --- a/tests/pos/interleaving-typeApply.scala +++ b/tests/pos/interleaving-typeApply.scala @@ -1,3 +1,5 @@ +//> using options -experimental + import scala.language.experimental.clauseInterleaving object typeApply: diff --git a/tests/pos/kindPolySemiGroup.scala b/tests/pos/kindPolySemiGroup.scala index b267ad8f9124..3640d8ea09c8 100644 --- a/tests/pos/kindPolySemiGroup.scala +++ b/tests/pos/kindPolySemiGroup.scala @@ -1,3 +1,5 @@ +//> using options -experimental + // Adapted from github:mandubian/kind-polymorphic-semigroup.scala import language.experimental.namedTypeArguments sealed trait HList diff --git a/tests/pos/named-typeargs.scala b/tests/pos/named-typeargs.scala index 10687b209fc0..872f98c9496b 100644 --- a/tests/pos/named-typeargs.scala +++ b/tests/pos/named-typeargs.scala @@ -1,3 +1,5 @@ +//> using options -experimental + import language.experimental.namedTypeArguments package namedTypeArgsR { diff --git a/tests/pos/namedTypeParams.scala b/tests/pos/namedTypeParams.scala index 388bcfa98bef..608eacd441a2 100644 --- a/tests/pos/namedTypeParams.scala +++ b/tests/pos/namedTypeParams.scala @@ -1,3 +1,5 @@ +//> using options -experimental + import language.experimental.namedTypeArguments object Test { diff --git a/tests/pos/overrides.scala b/tests/pos/overrides.scala index 146dc06c76a9..c3b6235d7c1f 100644 --- a/tests/pos/overrides.scala +++ b/tests/pos/overrides.scala @@ -1,7 +1,9 @@ +//> using options -experimental + class A[T] { def f(x: T)(y: T = x) = y - + import scala.language.experimental.clauseInterleaving def b[U <: T](x: Int)[V >: T](y: String) = false diff --git a/tests/pos/reference/adts.scala b/tests/pos/reference/adts.scala index 41ea6660638e..ad0ba4d768d4 100644 --- a/tests/pos/reference/adts.scala +++ b/tests/pos/reference/adts.scala @@ -1,3 +1,5 @@ +//> using options -experimental + package adts object t1: diff --git a/tests/pos/t1513a.scala b/tests/pos/t1513a.scala index fda45dca46d1..ff75bd067c5a 100644 --- a/tests/pos/t1513a.scala +++ b/tests/pos/t1513a.scala @@ -1,3 +1,5 @@ +//> using options -experimental + import language.experimental.namedTypeArguments object Test { // Heterogeneous lists and natural numbers as defined in shapeless. diff --git a/tests/pos/t1513b.scala b/tests/pos/t1513b.scala index 2e2e0efbd24a..d41c170a93f3 100644 --- a/tests/pos/t1513b.scala +++ b/tests/pos/t1513b.scala @@ -1,3 +1,5 @@ +//> using options -experimental + import language.experimental.namedTypeArguments object Test { def f[ diff --git a/tests/pos/tailrec.scala b/tests/pos/tailrec.scala index 95e667c07515..fa49469b6fc9 100644 --- a/tests/pos/tailrec.scala +++ b/tests/pos/tailrec.scala @@ -1,4 +1,4 @@ -//> using options -language:experimental.erasedDefinitions +//> using options -experimental -language:experimental.erasedDefinitions import scala.annotation.tailrec diff --git a/tests/pos/tupled-function-instances.scala b/tests/pos/tupled-function-instances.scala index 3b2d2aae40b2..b0af67aabfe4 100644 --- a/tests/pos/tupled-function-instances.scala +++ b/tests/pos/tupled-function-instances.scala @@ -1,3 +1,5 @@ +//> using options -experimental + import scala.util.TupledFunction object Test { def main(args: Array[String]): Unit = { diff --git a/tests/pos/typeclass-encoding3.scala b/tests/pos/typeclass-encoding3.scala index ee42c7ba9e28..7a644ad61a28 100644 --- a/tests/pos/typeclass-encoding3.scala +++ b/tests/pos/typeclass-encoding3.scala @@ -1,3 +1,5 @@ +//> using options -experimental + import language.experimental.namedTypeArguments object Test { diff --git a/tests/run/i13691.scala b/tests/run-custom-args/erased/i13691.scala similarity index 100% rename from tests/run/i13691.scala rename to tests/run-custom-args/erased/i13691.scala diff --git a/tests/run-macros/i17105/Lib1.scala b/tests/run-custom-args/erased/i17105/Lib1.scala similarity index 100% rename from tests/run-macros/i17105/Lib1.scala rename to tests/run-custom-args/erased/i17105/Lib1.scala diff --git a/tests/run-macros/i17105/Macro_2.scala b/tests/run-custom-args/erased/i17105/Macro_2.scala similarity index 100% rename from tests/run-macros/i17105/Macro_2.scala rename to tests/run-custom-args/erased/i17105/Macro_2.scala diff --git a/tests/run-macros/i17105/Test_3.scala b/tests/run-custom-args/erased/i17105/Test_3.scala similarity index 100% rename from tests/run-macros/i17105/Test_3.scala rename to tests/run-custom-args/erased/i17105/Test_3.scala diff --git a/tests/run/polymorphic-erased-functions.scala b/tests/run-custom-args/erased/polymorphic-erased-functions.scala similarity index 100% rename from tests/run/polymorphic-erased-functions.scala rename to tests/run-custom-args/erased/polymorphic-erased-functions.scala diff --git a/tests/run/quotes-add-erased/Macro_1.scala b/tests/run-custom-args/erased/quotes-add-erased/Macro_1.scala similarity index 100% rename from tests/run/quotes-add-erased/Macro_1.scala rename to tests/run-custom-args/erased/quotes-add-erased/Macro_1.scala diff --git a/tests/run/quotes-add-erased/Test_2.scala b/tests/run-custom-args/erased/quotes-add-erased/Test_2.scala similarity index 100% rename from tests/run/quotes-add-erased/Test_2.scala rename to tests/run-custom-args/erased/quotes-add-erased/Test_2.scala diff --git a/tests/run/quotes-reflection/Macros_1.scala b/tests/run-custom-args/erased/quotes-reflection/Macros_1.scala similarity index 100% rename from tests/run/quotes-reflection/Macros_1.scala rename to tests/run-custom-args/erased/quotes-reflection/Macros_1.scala diff --git a/tests/run/quotes-reflection/Test_2.scala b/tests/run-custom-args/erased/quotes-reflection/Test_2.scala similarity index 100% rename from tests/run/quotes-reflection/Test_2.scala rename to tests/run-custom-args/erased/quotes-reflection/Test_2.scala diff --git a/tests/run/safeThrowsStrawman.scala b/tests/run-custom-args/erased/safeThrowsStrawman.scala similarity index 100% rename from tests/run/safeThrowsStrawman.scala rename to tests/run-custom-args/erased/safeThrowsStrawman.scala diff --git a/tests/run/safeThrowsStrawman2.scala b/tests/run-custom-args/erased/safeThrowsStrawman2.scala similarity index 100% rename from tests/run/safeThrowsStrawman2.scala rename to tests/run-custom-args/erased/safeThrowsStrawman2.scala diff --git a/tests/run-deep-subtype/Tuple-reverse.scala b/tests/run-deep-subtype/Tuple-reverse.scala index b0461d167fab..c611ba504d82 100644 --- a/tests/run-deep-subtype/Tuple-reverse.scala +++ b/tests/run-deep-subtype/Tuple-reverse.scala @@ -1,3 +1,5 @@ +//> using options -experimental + import scala.reflect.ClassTag object Test { diff --git a/tests/run-macros/BigFloat/BigFloatFromDigitsImpl_1.scala b/tests/run-macros/BigFloat/BigFloatFromDigitsImpl_1.scala index 0731abf11174..f1a7b90395b0 100644 --- a/tests/run-macros/BigFloat/BigFloatFromDigitsImpl_1.scala +++ b/tests/run-macros/BigFloat/BigFloatFromDigitsImpl_1.scala @@ -1,3 +1,5 @@ +//> using options -experimental + package test import language.experimental.genericNumberLiterals import scala.util.FromDigits diff --git a/tests/run-macros/BigFloat/Test_2.scala b/tests/run-macros/BigFloat/Test_2.scala index 49690d2ffe80..4e3464b987a3 100644 --- a/tests/run-macros/BigFloat/Test_2.scala +++ b/tests/run-macros/BigFloat/Test_2.scala @@ -1,3 +1,5 @@ +//> using options -experimental + import test.BigFloat import language.experimental.genericNumberLiterals import scala.util.FromDigits diff --git a/tests/run-macros/Xmacro-settings-compileTimeEnv/MacroEnv.scala b/tests/run-macros/Xmacro-settings-compileTimeEnv/MacroEnv.scala index bde3719396aa..94245039a948 100644 --- a/tests/run-macros/Xmacro-settings-compileTimeEnv/MacroEnv.scala +++ b/tests/run-macros/Xmacro-settings-compileTimeEnv/MacroEnv.scala @@ -1,3 +1,5 @@ +//> using options -experimental + import scala.quoted.* object MacroEnv { diff --git a/tests/run-macros/Xmacro-settings-simple/M1.scala b/tests/run-macros/Xmacro-settings-simple/M1.scala index 1210d1abe05e..487ad5baec46 100644 --- a/tests/run-macros/Xmacro-settings-simple/M1.scala +++ b/tests/run-macros/Xmacro-settings-simple/M1.scala @@ -1,3 +1,5 @@ +//> using options -experimental + package x import scala.quoted.* diff --git a/tests/run-macros/annot-add-global-class/Test_2.scala b/tests/run-macros/annot-add-global-class/Test_2.scala index 11386bcc0bc5..6fa058060906 100644 --- a/tests/run-macros/annot-add-global-class/Test_2.scala +++ b/tests/run-macros/annot-add-global-class/Test_2.scala @@ -1,3 +1,5 @@ +//> using options -experimental + import mymacro.addClass @addClass def foo(): Unit = diff --git a/tests/run-macros/annot-add-global-object/Test_2.scala b/tests/run-macros/annot-add-global-object/Test_2.scala index 2007c751bbec..b3c7dbff1558 100644 --- a/tests/run-macros/annot-add-global-object/Test_2.scala +++ b/tests/run-macros/annot-add-global-object/Test_2.scala @@ -1,3 +1,5 @@ +//> using options -experimental + @addClass def foo(): Unit = println("macro generated main") println("executed in: " + (new Throwable().getStackTrace().head.getClassName)) diff --git a/tests/run-macros/annot-add-local-class/Macro_1.scala b/tests/run-macros/annot-add-local-class/Macro_1.scala index 8cbf30dfc923..069f94668d1c 100644 --- a/tests/run-macros/annot-add-local-class/Macro_1.scala +++ b/tests/run-macros/annot-add-local-class/Macro_1.scala @@ -1,3 +1,5 @@ +//> using options -experimental + import scala.annotation.{experimental, MacroAnnotation} import scala.quoted._ import scala.collection.mutable diff --git a/tests/run-macros/annot-add-local-class/Test_2.scala b/tests/run-macros/annot-add-local-class/Test_2.scala index e52ca30f8d9f..ece281dcb56c 100644 --- a/tests/run-macros/annot-add-local-class/Test_2.scala +++ b/tests/run-macros/annot-add-local-class/Test_2.scala @@ -1,3 +1,5 @@ +//> using options -experimental + @main def Test(): Unit = @addClass def foo(): Unit = println("macro generated main") diff --git a/tests/run-macros/annot-add-local-object/Test_2.scala b/tests/run-macros/annot-add-local-object/Test_2.scala index a7f6d74a02e2..2dfcc801d61a 100644 --- a/tests/run-macros/annot-add-local-object/Test_2.scala +++ b/tests/run-macros/annot-add-local-object/Test_2.scala @@ -1,3 +1,5 @@ +//> using options -experimental + @main def Test(): Unit = @addClass def foo(): Unit = println("macro generated main") diff --git a/tests/run-macros/annot-add-nested-class/Macro_1.scala b/tests/run-macros/annot-add-nested-class/Macro_1.scala index 2edbe5e48cd3..2db2bddf1fc9 100644 --- a/tests/run-macros/annot-add-nested-class/Macro_1.scala +++ b/tests/run-macros/annot-add-nested-class/Macro_1.scala @@ -1,3 +1,5 @@ +//> using options -experimental + import scala.annotation.{experimental, MacroAnnotation} import scala.quoted._ import scala.collection.mutable diff --git a/tests/run-macros/annot-add-nested-class/Test_2.scala b/tests/run-macros/annot-add-nested-class/Test_2.scala index f363cf58c3a4..e328f97218d3 100644 --- a/tests/run-macros/annot-add-nested-class/Test_2.scala +++ b/tests/run-macros/annot-add-nested-class/Test_2.scala @@ -1,3 +1,5 @@ +//> using options -experimental + class Foo(): @addClass def foo(): Unit = println("macro generated main") diff --git a/tests/run-macros/annot-add-nested-object/Test_2.scala b/tests/run-macros/annot-add-nested-object/Test_2.scala index 2bf54d73d0e6..f466cf59980b 100644 --- a/tests/run-macros/annot-add-nested-object/Test_2.scala +++ b/tests/run-macros/annot-add-nested-object/Test_2.scala @@ -1,3 +1,5 @@ +//> using options -experimental + class Foo(): @addClass def foo(): Unit = println("macro generated main") diff --git a/tests/run-macros/annot-annot-order/Test_2.scala b/tests/run-macros/annot-annot-order/Test_2.scala index a112c0a2e096..9f312c47c6af 100644 --- a/tests/run-macros/annot-annot-order/Test_2.scala +++ b/tests/run-macros/annot-annot-order/Test_2.scala @@ -1,3 +1,5 @@ +//> using options -experimental + @print("foo") def foo(): Unit = () diff --git a/tests/run-macros/annot-bind/Test_2.scala b/tests/run-macros/annot-bind/Test_2.scala index e30ead520721..44726e69adc7 100644 --- a/tests/run-macros/annot-bind/Test_2.scala +++ b/tests/run-macros/annot-bind/Test_2.scala @@ -1,3 +1,5 @@ +//> using options -experimental + @bind("a") val foo: String = "foo" diff --git a/tests/run-macros/annot-changeVal/Test_2.scala b/tests/run-macros/annot-changeVal/Test_2.scala index 6e0e44ad8885..6816712a43a0 100644 --- a/tests/run-macros/annot-changeVal/Test_2.scala +++ b/tests/run-macros/annot-changeVal/Test_2.scala @@ -1,3 +1,5 @@ +//> using options -experimental + import ChangeVal._ class Bar: diff --git a/tests/run-macros/annot-gen2/Test_3.scala b/tests/run-macros/annot-gen2/Test_3.scala index 1a7ca80f6479..2b2a86aabfac 100644 --- a/tests/run-macros/annot-gen2/Test_3.scala +++ b/tests/run-macros/annot-gen2/Test_3.scala @@ -1,3 +1,5 @@ +//> using options -experimental + class Bar: @foo def bar(s: String) = s diff --git a/tests/run-macros/annot-generate/Test_3.scala b/tests/run-macros/annot-generate/Test_3.scala index 7077fd544111..8c8509c81c46 100644 --- a/tests/run-macros/annot-generate/Test_3.scala +++ b/tests/run-macros/annot-generate/Test_3.scala @@ -1,3 +1,5 @@ +//> using options -experimental + class Bar: @foo def bar(x: Int) = x + 1 diff --git a/tests/run-macros/annot-macro-main/Test_2.scala b/tests/run-macros/annot-macro-main/Test_2.scala index cdf7f6fd78da..45c1b7b0ebfc 100644 --- a/tests/run-macros/annot-macro-main/Test_2.scala +++ b/tests/run-macros/annot-macro-main/Test_2.scala @@ -1 +1,3 @@ +//> using options -experimental + @mainMacro def Test(): Unit = println("macro generated main") diff --git a/tests/run-macros/annot-memo/Test_2.scala b/tests/run-macros/annot-memo/Test_2.scala index 10afee3fa8bc..ad39ec43a6c3 100644 --- a/tests/run-macros/annot-memo/Test_2.scala +++ b/tests/run-macros/annot-memo/Test_2.scala @@ -1,3 +1,5 @@ +//> using options -experimental + class Bar: @memoize def fib(n: Int): Int = diff --git a/tests/run-macros/annot-mod-class-add-def/Test_2.scala b/tests/run-macros/annot-mod-class-add-def/Test_2.scala index 05596baee900..61eabc28878d 100644 --- a/tests/run-macros/annot-mod-class-add-def/Test_2.scala +++ b/tests/run-macros/annot-mod-class-add-def/Test_2.scala @@ -1,3 +1,5 @@ +//> using options -experimental + @addIndirectToString("This is Foo") class Foo //> private def string$macro$1: String = "This is Foo" diff --git a/tests/run-macros/annot-mod-class-add-inner-class/Test_2.scala b/tests/run-macros/annot-mod-class-add-inner-class/Test_2.scala index d06d13c439e6..bba522b5f2c4 100644 --- a/tests/run-macros/annot-mod-class-add-inner-class/Test_2.scala +++ b/tests/run-macros/annot-mod-class-add-inner-class/Test_2.scala @@ -1,3 +1,5 @@ +//> using options -experimental + @addInnerClass class Foo //> class Show: diff --git a/tests/run-macros/annot-mod-class-add-lazy-val/Test_2.scala b/tests/run-macros/annot-mod-class-add-lazy-val/Test_2.scala index 657b40b42fc8..3dcab1f0d535 100644 --- a/tests/run-macros/annot-mod-class-add-lazy-val/Test_2.scala +++ b/tests/run-macros/annot-mod-class-add-lazy-val/Test_2.scala @@ -1,3 +1,5 @@ +//> using options -experimental + @addMemoToString("This is Foo") class Foo //> private lazy val string$macro$1: String = "This is Foo" diff --git a/tests/run-macros/annot-mod-class-add-local-class/Test_2.scala b/tests/run-macros/annot-mod-class-add-local-class/Test_2.scala index 60aa28ffaf2a..f313900635c9 100644 --- a/tests/run-macros/annot-mod-class-add-local-class/Test_2.scala +++ b/tests/run-macros/annot-mod-class-add-local-class/Test_2.scala @@ -1,3 +1,5 @@ +//> using options -experimental + @addInnerClass class Foo //> def toString(): String = diff --git a/tests/run-macros/annot-mod-class-add-val/Test_2.scala b/tests/run-macros/annot-mod-class-add-val/Test_2.scala index 40816f5c8c84..8c4af8f79ce9 100644 --- a/tests/run-macros/annot-mod-class-add-val/Test_2.scala +++ b/tests/run-macros/annot-mod-class-add-val/Test_2.scala @@ -1,3 +1,5 @@ +//> using options -experimental + @addMemoToString("This is Foo") class Foo //> private val string$macro$1: String = "This is Foo" diff --git a/tests/run-macros/annot-mod-class-add-var/Test_2.scala b/tests/run-macros/annot-mod-class-add-var/Test_2.scala index 5058e826b863..cb8ea1db8313 100644 --- a/tests/run-macros/annot-mod-class-add-var/Test_2.scala +++ b/tests/run-macros/annot-mod-class-add-var/Test_2.scala @@ -1,3 +1,5 @@ +//> using options -experimental + @addCountToString("This is Foo: ") class Foo: //> private var count$macro$1: Int = 0 diff --git a/tests/run-macros/annot-mod-class-data/Test_2.scala b/tests/run-macros/annot-mod-class-data/Test_2.scala index 23e5191a3aeb..b6007562f820 100644 --- a/tests/run-macros/annot-mod-class-data/Test_2.scala +++ b/tests/run-macros/annot-mod-class-data/Test_2.scala @@ -1,3 +1,5 @@ +//> using options -experimental + @data class Foo(val a: String, val b: Int) //> override def toString(): String = Seq(this.a, this.b).mkString("Foo(", ", ", ")") //> override def equals(that: Any): Boolean = diff --git a/tests/run-macros/annot-mod-class-equals/Test_2.scala b/tests/run-macros/annot-mod-class-equals/Test_2.scala index a4b3b406c4ce..82981f303568 100644 --- a/tests/run-macros/annot-mod-class-equals/Test_2.scala +++ b/tests/run-macros/annot-mod-class-equals/Test_2.scala @@ -1,3 +1,5 @@ +//> using options -experimental + @equals class Foo(val a: String, val b: Int) //> override def equals(that: Any): Boolean = //> that match diff --git a/tests/run-macros/annot-mod-class-mod-def/Test_2.scala b/tests/run-macros/annot-mod-class-mod-def/Test_2.scala index 7e5da4d7b31d..d7d03fcb661c 100644 --- a/tests/run-macros/annot-mod-class-mod-def/Test_2.scala +++ b/tests/run-macros/annot-mod-class-mod-def/Test_2.scala @@ -1,3 +1,5 @@ +//> using options -experimental + @modToString("This is Foo") class Foo: override def toString(): String = "?" //> override def toString(): String = "This is Foo" diff --git a/tests/run-macros/annot-mod-class-mod-val/Macro_1.scala b/tests/run-macros/annot-mod-class-mod-val/Macro_1.scala index 036703a8a374..f352908afd5c 100644 --- a/tests/run-macros/annot-mod-class-mod-val/Macro_1.scala +++ b/tests/run-macros/annot-mod-class-mod-val/Macro_1.scala @@ -1,3 +1,5 @@ +//> using options -experimental + import scala.annotation.{experimental, MacroAnnotation} import scala.quoted._ import scala.collection.mutable diff --git a/tests/run-macros/annot-mod-class-mod-val/Test_2.scala b/tests/run-macros/annot-mod-class-mod-val/Test_2.scala index d75138f0dc41..17e5cae85155 100644 --- a/tests/run-macros/annot-mod-class-mod-val/Test_2.scala +++ b/tests/run-macros/annot-mod-class-mod-val/Test_2.scala @@ -1,3 +1,5 @@ +//> using options -experimental + @setValue("valDef", "a") @setValue("varDef", "b") @setValue("lazyVarDef", "c") diff --git a/tests/run-macros/annot-mod-class-override-def/Macro_1.scala b/tests/run-macros/annot-mod-class-override-def/Macro_1.scala index 7d591a39b091..04934c9ca645 100644 --- a/tests/run-macros/annot-mod-class-override-def/Macro_1.scala +++ b/tests/run-macros/annot-mod-class-override-def/Macro_1.scala @@ -1,3 +1,5 @@ +//> using options -experimental + import scala.annotation.{experimental, MacroAnnotation} import scala.quoted._ import scala.collection.mutable diff --git a/tests/run-macros/annot-mod-class-override-def/Test_2.scala b/tests/run-macros/annot-mod-class-override-def/Test_2.scala index 0fca75ba9d6a..8aa04610d039 100644 --- a/tests/run-macros/annot-mod-class-override-def/Test_2.scala +++ b/tests/run-macros/annot-mod-class-override-def/Test_2.scala @@ -1,3 +1,5 @@ +//> using options -experimental + @genToString("This is Foo") class Foo //> override def toString(): String = "This is Foo" diff --git a/tests/run-macros/annot-mod-class-override-val/Test_2.scala b/tests/run-macros/annot-mod-class-override-val/Test_2.scala index 52d56723980d..b633031b9f6d 100644 --- a/tests/run-macros/annot-mod-class-override-val/Test_2.scala +++ b/tests/run-macros/annot-mod-class-override-val/Test_2.scala @@ -1,3 +1,5 @@ +//> using options -experimental + class Foo: val val1: String = "?" def def1: String = "?" diff --git a/tests/run-macros/annot-mod-class-unused-new-sym/Macro_1.scala b/tests/run-macros/annot-mod-class-unused-new-sym/Macro_1.scala index 0da1e4106e8e..f754d7deabad 100644 --- a/tests/run-macros/annot-mod-class-unused-new-sym/Macro_1.scala +++ b/tests/run-macros/annot-mod-class-unused-new-sym/Macro_1.scala @@ -1,3 +1,5 @@ +//> using options -experimental + import scala.annotation.{experimental, MacroAnnotation} import scala.quoted._ import scala.collection.mutable diff --git a/tests/run-macros/annot-mod-class-unused-new-sym/Test_2.scala b/tests/run-macros/annot-mod-class-unused-new-sym/Test_2.scala index dd93d0df2917..598f8fa1fc09 100644 --- a/tests/run-macros/annot-mod-class-unused-new-sym/Test_2.scala +++ b/tests/run-macros/annot-mod-class-unused-new-sym/Test_2.scala @@ -1,3 +1,5 @@ +//> using options -experimental + @newUnusedSymbol class Foo diff --git a/tests/run-macros/annot-result-order/Macro_1.scala b/tests/run-macros/annot-result-order/Macro_1.scala index 5976e27965ef..b3db645e0bcf 100644 --- a/tests/run-macros/annot-result-order/Macro_1.scala +++ b/tests/run-macros/annot-result-order/Macro_1.scala @@ -1,3 +1,5 @@ +//> using options -experimental + import scala.annotation.{experimental, MacroAnnotation} import scala.quoted._ diff --git a/tests/run-macros/annot-result-order/Test_2.scala b/tests/run-macros/annot-result-order/Test_2.scala index fce105f3cc6c..0f356a447772 100644 --- a/tests/run-macros/annot-result-order/Test_2.scala +++ b/tests/run-macros/annot-result-order/Test_2.scala @@ -1,3 +1,5 @@ +//> using options -experimental + @print("foo") def foo(): Unit = () diff --git a/tests/run-macros/annot-simple-fib/Macro_1.scala b/tests/run-macros/annot-simple-fib/Macro_1.scala index 1740f922b63e..e5d06144e5bf 100644 --- a/tests/run-macros/annot-simple-fib/Macro_1.scala +++ b/tests/run-macros/annot-simple-fib/Macro_1.scala @@ -1,3 +1,5 @@ +//> using options -experimental + import scala.annotation.{experimental, MacroAnnotation} import scala.quoted._ import scala.collection.mutable.Map diff --git a/tests/run-macros/annot-simple-fib/Test_2.scala b/tests/run-macros/annot-simple-fib/Test_2.scala index 7e22982553ac..ace473d848a0 100644 --- a/tests/run-macros/annot-simple-fib/Test_2.scala +++ b/tests/run-macros/annot-simple-fib/Test_2.scala @@ -1,3 +1,5 @@ +//> using options -experimental + class Bar: @memoize def fib(n: Int): Int = diff --git a/tests/run-macros/expr-mirror-info/Lib_1.scala b/tests/run-macros/expr-mirror-info/Lib_1.scala index d4d50ce71012..d636a1c8bae2 100644 --- a/tests/run-macros/expr-mirror-info/Lib_1.scala +++ b/tests/run-macros/expr-mirror-info/Lib_1.scala @@ -1,3 +1,5 @@ +//> using options -experimental + import scala.deriving.Mirror import scala.quoted.* diff --git a/tests/run-macros/expr-mirror-info/Test_2.scala b/tests/run-macros/expr-mirror-info/Test_2.scala index 0b72d0032bd1..11ee7ffda86a 100644 --- a/tests/run-macros/expr-mirror-info/Test_2.scala +++ b/tests/run-macros/expr-mirror-info/Test_2.scala @@ -1,3 +1,5 @@ +//> using options -experimental + import scala.deriving.Mirror case class Foo[T](x: Int, y: Double, z: T) diff --git a/tests/run-macros/i11685/Macro_1.scala b/tests/run-macros/i11685/Macro_1.scala index 08920854a813..2723d5898050 100644 --- a/tests/run-macros/i11685/Macro_1.scala +++ b/tests/run-macros/i11685/Macro_1.scala @@ -1,3 +1,5 @@ +//> using options -experimental + package test import scala.quoted.* diff --git a/tests/run-macros/i11685/Test_2.scala b/tests/run-macros/i11685/Test_2.scala index f8531376dcd8..32278480a2df 100644 --- a/tests/run-macros/i11685/Test_2.scala +++ b/tests/run-macros/i11685/Test_2.scala @@ -1,3 +1,5 @@ +//> using options -experimental + import test.MyMacro trait Command { diff --git a/tests/run-macros/i12021/Macro_1.scala b/tests/run-macros/i12021/Macro_1.scala index 25cab1786146..5592da075e5b 100644 --- a/tests/run-macros/i12021/Macro_1.scala +++ b/tests/run-macros/i12021/Macro_1.scala @@ -1,3 +1,5 @@ +//> using options -experimental + import scala.quoted.* inline def inspect[A]: String = diff --git a/tests/run-macros/i12021/Test_2.scala b/tests/run-macros/i12021/Test_2.scala index a542b14f1175..e5990e01e34b 100644 --- a/tests/run-macros/i12021/Test_2.scala +++ b/tests/run-macros/i12021/Test_2.scala @@ -1,3 +1,5 @@ +//> using options -experimental + import scala.language.experimental.erasedDefinitions erased class EC diff --git a/tests/run-macros/i17105b/Test_2.scala b/tests/run-macros/i17105b/Test_2.scala index 46781b558dd4..7a8615fc7051 100644 --- a/tests/run-macros/i17105b/Test_2.scala +++ b/tests/run-macros/i17105b/Test_2.scala @@ -1,3 +1,5 @@ +//> using options -experimental + import scala.language.experimental.erasedDefinitions @main def Test: Unit = diff --git a/tests/run-macros/macro-erased/Macro_1.scala b/tests/run-macros/macro-erased/Macro_1.scala index 2e863f24650b..1eefa9dbd859 100644 --- a/tests/run-macros/macro-erased/Macro_1.scala +++ b/tests/run-macros/macro-erased/Macro_1.scala @@ -1,3 +1,5 @@ +//> using options -experimental + import scala.language.experimental.erasedDefinitions import scala.quoted.* diff --git a/tests/run-macros/macro-erased/Test_2.scala b/tests/run-macros/macro-erased/Test_2.scala index 1f7f8be436c7..880099021609 100644 --- a/tests/run-macros/macro-erased/Test_2.scala +++ b/tests/run-macros/macro-erased/Test_2.scala @@ -1,3 +1,5 @@ +//> using options -experimental + object Test { def main(args: Array[String]): Unit = { assert(Macro.foo1(1) == 0) diff --git a/tests/run-macros/newClass/Macro_1.scala b/tests/run-macros/newClass/Macro_1.scala index e7ae59c5331b..0ad619c3d9c4 100644 --- a/tests/run-macros/newClass/Macro_1.scala +++ b/tests/run-macros/newClass/Macro_1.scala @@ -1,3 +1,5 @@ +//> using options -experimental + import scala.quoted.* inline def makeClass(inline name: String): Any = ${ makeClassExpr('name) } diff --git a/tests/run-macros/newClass/Test_2.scala b/tests/run-macros/newClass/Test_2.scala index 6868674547fe..8cf726d89d0b 100644 --- a/tests/run-macros/newClass/Test_2.scala +++ b/tests/run-macros/newClass/Test_2.scala @@ -1,3 +1,5 @@ +//> using options -experimental + @main def Test: Unit = { val foo = makeClass("foo") println(foo.getClass) diff --git a/tests/run-macros/newClassExtends/Macro_1.scala b/tests/run-macros/newClassExtends/Macro_1.scala index 99f639158761..8b817f2674b2 100644 --- a/tests/run-macros/newClassExtends/Macro_1.scala +++ b/tests/run-macros/newClassExtends/Macro_1.scala @@ -1,3 +1,5 @@ +//> using options -experimental + import scala.quoted.* inline def makeClass(inline name: String): Foo = ${ makeClassExpr('name) } diff --git a/tests/run-macros/newClassExtends/Test_2.scala b/tests/run-macros/newClassExtends/Test_2.scala index 1db791749bab..6e902825fdc6 100644 --- a/tests/run-macros/newClassExtends/Test_2.scala +++ b/tests/run-macros/newClassExtends/Test_2.scala @@ -1,3 +1,5 @@ +//> using options -experimental + @main def Test: Unit = { val foo: Foo = makeClass("foo") foo.foo() diff --git a/tests/run-macros/newClassExtendsClassParams/Macro_1.scala b/tests/run-macros/newClassExtendsClassParams/Macro_1.scala index f6eebc9487e5..99e639e0aa4f 100644 --- a/tests/run-macros/newClassExtendsClassParams/Macro_1.scala +++ b/tests/run-macros/newClassExtendsClassParams/Macro_1.scala @@ -1,3 +1,5 @@ +//> using options -experimental + import scala.quoted.* inline def makeClass(inline name: String): Foo = ${ makeClassExpr('name) } diff --git a/tests/run-macros/newClassExtendsClassParams/Test_2.scala b/tests/run-macros/newClassExtendsClassParams/Test_2.scala index 1db791749bab..6e902825fdc6 100644 --- a/tests/run-macros/newClassExtendsClassParams/Test_2.scala +++ b/tests/run-macros/newClassExtendsClassParams/Test_2.scala @@ -1,3 +1,5 @@ +//> using options -experimental + @main def Test: Unit = { val foo: Foo = makeClass("foo") foo.foo() diff --git a/tests/run-macros/newClassSelf/Macro_1.scala b/tests/run-macros/newClassSelf/Macro_1.scala index 864015c896f0..8562b814677d 100644 --- a/tests/run-macros/newClassSelf/Macro_1.scala +++ b/tests/run-macros/newClassSelf/Macro_1.scala @@ -1,3 +1,5 @@ +//> using options -experimental + import scala.quoted.* inline def makeClass(inline name: String): Bar = ${ makeClassExpr('name) } diff --git a/tests/run-macros/newClassSelf/Test_2.scala b/tests/run-macros/newClassSelf/Test_2.scala index 0c6d522de58f..1c1f64fd20e3 100644 --- a/tests/run-macros/newClassSelf/Test_2.scala +++ b/tests/run-macros/newClassSelf/Test_2.scala @@ -1,3 +1,5 @@ +//> using options -experimental + @main def Test: Unit = { val a: Bar = makeClass("A") a.bar() diff --git a/tests/run-macros/tasty-definitions-1/quoted_1.scala b/tests/run-macros/tasty-definitions-1/quoted_1.scala index f5538cb903dc..e91c84f27e8c 100644 --- a/tests/run-macros/tasty-definitions-1/quoted_1.scala +++ b/tests/run-macros/tasty-definitions-1/quoted_1.scala @@ -1,3 +1,5 @@ +//> using options -experimental + import scala.quoted.* object Macros { diff --git a/tests/run-macros/tasty-definitions-1/quoted_2.scala b/tests/run-macros/tasty-definitions-1/quoted_2.scala index 47167a52f1d9..2d30de945124 100644 --- a/tests/run-macros/tasty-definitions-1/quoted_2.scala +++ b/tests/run-macros/tasty-definitions-1/quoted_2.scala @@ -1,5 +1,4 @@ -//> using options -Yretain-trees - +//> using options -Yretain-trees -experimental object Test { def main(args: Array[String]): Unit = { Macros.testDefinitions() 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 diff --git a/tests/run-macros/term-show/Test_2.scala b/tests/run-macros/term-show/Test_2.scala index eebd50576930..40c7fc03e63e 100644 --- a/tests/run-macros/term-show/Test_2.scala +++ b/tests/run-macros/term-show/Test_2.scala @@ -1,3 +1,5 @@ +//> using options -experimental + import scala.language.experimental.erasedDefinitions trait A: diff --git a/tests/run-staging/staged-streams_1.scala b/tests/run-staging/staged-streams_1.scala index 5315f66871ca..b826c9465913 100644 --- a/tests/run-staging/staged-streams_1.scala +++ b/tests/run-staging/staged-streams_1.scala @@ -1,3 +1,5 @@ +//> using options -experimental + import scala.quoted.* import scala.quoted.staging.* import language.experimental.namedTypeArguments diff --git a/tests/run/Parser.scala b/tests/run/Parser.scala index 48c3af73ecec..78a30cac09ed 100644 --- a/tests/run/Parser.scala +++ b/tests/run/Parser.scala @@ -1,3 +1,5 @@ +//> using options -experimental + import language.experimental.into type Input = List[String] diff --git a/tests/run/convertible.scala b/tests/run/convertible.scala index 0670d1949fd9..ab5d45ab89ce 100644 --- a/tests/run/convertible.scala +++ b/tests/run/convertible.scala @@ -1,4 +1,4 @@ -//> using options -Xfatal-warnings +//> using options -Xfatal-warnings -experimental import language.experimental.into diff --git a/tests/run/erased-1.scala b/tests/run/erased-1.scala index 9875d7b1d68b..3dea4695a350 100644 --- a/tests/run/erased-1.scala +++ b/tests/run/erased-1.scala @@ -1,4 +1,4 @@ -//> using options -language:experimental.erasedDefinitions +//> using options -experimental -language:experimental.erasedDefinitions object Test { diff --git a/tests/run/erased-10.scala b/tests/run/erased-10.scala index 004d07b4de37..c195ee093e0a 100644 --- a/tests/run/erased-10.scala +++ b/tests/run/erased-10.scala @@ -1,4 +1,4 @@ -//> using options -language:experimental.erasedDefinitions +//> using options -experimental -language:experimental.erasedDefinitions object Test { diff --git a/tests/run/erased-11.scala b/tests/run/erased-11.scala index 0963f5105142..4315c9afa864 100644 --- a/tests/run/erased-11.scala +++ b/tests/run/erased-11.scala @@ -1,4 +1,4 @@ -//> using options -language:experimental.erasedDefinitions +//> using options -experimental -language:experimental.erasedDefinitions object Test { diff --git a/tests/run/erased-12.scala b/tests/run/erased-12.scala index be641b8b95c2..6a2987d64b1b 100644 --- a/tests/run/erased-12.scala +++ b/tests/run/erased-12.scala @@ -1,4 +1,4 @@ -//> using options -language:experimental.erasedDefinitions +//> using options -experimental -language:experimental.erasedDefinitions object Test { diff --git a/tests/run/erased-13.scala b/tests/run/erased-13.scala index 55dce8ac3e7b..e2f54edff6c5 100644 --- a/tests/run/erased-13.scala +++ b/tests/run/erased-13.scala @@ -1,4 +1,4 @@ -//> using options -language:experimental.erasedDefinitions +//> using options -experimental -language:experimental.erasedDefinitions object Test { diff --git a/tests/run/erased-14.scala b/tests/run/erased-14.scala index 7d10af210a41..abd9bdd22c5c 100644 --- a/tests/run/erased-14.scala +++ b/tests/run/erased-14.scala @@ -1,4 +1,4 @@ -//> using options -language:experimental.erasedDefinitions +//> using options -experimental -language:experimental.erasedDefinitions object Test { diff --git a/tests/run/erased-15.scala b/tests/run/erased-15.scala index ac3adc428ffb..7d2e766b1bac 100644 --- a/tests/run/erased-15.scala +++ b/tests/run/erased-15.scala @@ -1,4 +1,4 @@ -//> using options -language:experimental.erasedDefinitions +//> using options -experimental -language:experimental.erasedDefinitions object Test { diff --git a/tests/run/erased-16.scala b/tests/run/erased-16.scala index f879165bffa1..7a258d3af87e 100644 --- a/tests/run/erased-16.scala +++ b/tests/run/erased-16.scala @@ -1,4 +1,4 @@ -//> using options -language:experimental.erasedDefinitions +//> using options -experimental -language:experimental.erasedDefinitions object Test { diff --git a/tests/run/erased-17.scala b/tests/run/erased-17.scala index b64b01952192..2661ca33b8eb 100644 --- a/tests/run/erased-17.scala +++ b/tests/run/erased-17.scala @@ -1,4 +1,4 @@ -//> using options -language:experimental.erasedDefinitions +//> using options -experimental -language:experimental.erasedDefinitions object Test { diff --git a/tests/run/erased-18.scala b/tests/run/erased-18.scala index 46f7e44c7309..589893f9cc73 100644 --- a/tests/run/erased-18.scala +++ b/tests/run/erased-18.scala @@ -1,4 +1,4 @@ -//> using options -language:experimental.erasedDefinitions +//> using options -experimental -language:experimental.erasedDefinitions object Test { diff --git a/tests/run/erased-19.scala b/tests/run/erased-19.scala index 4bbcd1dd3bba..8329617ef631 100644 --- a/tests/run/erased-19.scala +++ b/tests/run/erased-19.scala @@ -1,4 +1,4 @@ -//> using options -language:experimental.erasedDefinitions +//> using options -experimental -language:experimental.erasedDefinitions object Test { diff --git a/tests/run/erased-20.scala b/tests/run/erased-20.scala index 7d07260c2d08..7380200c81ac 100644 --- a/tests/run/erased-20.scala +++ b/tests/run/erased-20.scala @@ -1,4 +1,4 @@ -//> using options -language:experimental.erasedDefinitions +//> using options -experimental -language:experimental.erasedDefinitions object Test { diff --git a/tests/run/erased-21.scala b/tests/run/erased-21.scala index 804f8f9c53ee..9b149d88abe1 100644 --- a/tests/run/erased-21.scala +++ b/tests/run/erased-21.scala @@ -1,4 +1,4 @@ -//> using options -language:experimental.erasedDefinitions +//> using options -experimental -language:experimental.erasedDefinitions object Test { diff --git a/tests/run/erased-22.scala b/tests/run/erased-22.scala index df05773e00b1..8052571d4a64 100644 --- a/tests/run/erased-22.scala +++ b/tests/run/erased-22.scala @@ -1,4 +1,4 @@ -//> using options -language:experimental.erasedDefinitions +//> using options -experimental -language:experimental.erasedDefinitions object Test { diff --git a/tests/run/erased-25.scala b/tests/run/erased-25.scala index bcfe4fe6d444..cbc78d52cc3f 100644 --- a/tests/run/erased-25.scala +++ b/tests/run/erased-25.scala @@ -1,4 +1,4 @@ -//> using options -language:experimental.erasedDefinitions +//> using options -experimental -language:experimental.erasedDefinitions object Test { def main(args: Array[String]): Unit = { diff --git a/tests/run/erased-26.scala b/tests/run/erased-26.scala index b3efd62bb9f6..050c6addc9c7 100644 --- a/tests/run/erased-26.scala +++ b/tests/run/erased-26.scala @@ -1,4 +1,4 @@ -//> using options -language:experimental.erasedDefinitions +//> using options -experimental -language:experimental.erasedDefinitions object Test { def main(args: Array[String]): Unit = { diff --git a/tests/run/erased-27.scala b/tests/run/erased-27.scala index 271a9ca47db9..fbbc6573ae80 100644 --- a/tests/run/erased-27.scala +++ b/tests/run/erased-27.scala @@ -1,4 +1,4 @@ -//> using options -language:experimental.erasedDefinitions +//> using options -experimental -language:experimental.erasedDefinitions object Test { def main(args: Array[String]): Unit = { diff --git a/tests/run/erased-28.scala b/tests/run/erased-28.scala index ae33b3dc5844..0e8108872bde 100644 --- a/tests/run/erased-28.scala +++ b/tests/run/erased-28.scala @@ -1,4 +1,4 @@ -//> using options -language:experimental.erasedDefinitions +//> using options -experimental -language:experimental.erasedDefinitions object Test { var a = true diff --git a/tests/run/erased-3.scala b/tests/run/erased-3.scala index a138e7dfd6f7..cea82ac52472 100644 --- a/tests/run/erased-3.scala +++ b/tests/run/erased-3.scala @@ -1,4 +1,4 @@ -//> using options -language:experimental.erasedDefinitions +//> using options -experimental -language:experimental.erasedDefinitions object Test { diff --git a/tests/run/erased-4.scala b/tests/run/erased-4.scala index 2e1e2ad64bbf..003129bacc55 100644 --- a/tests/run/erased-4.scala +++ b/tests/run/erased-4.scala @@ -1,4 +1,4 @@ -//> using options -language:experimental.erasedDefinitions +//> using options -experimental -language:experimental.erasedDefinitions object Test { diff --git a/tests/run/erased-5.scala b/tests/run/erased-5.scala index ced18c2426be..dbb446d2bf4e 100644 --- a/tests/run/erased-5.scala +++ b/tests/run/erased-5.scala @@ -1,4 +1,4 @@ -//> using options -language:experimental.erasedDefinitions +//> using options -experimental -language:experimental.erasedDefinitions object Test { diff --git a/tests/run/erased-6.scala b/tests/run/erased-6.scala index 4577aa7a03e9..d28d2a9e7f26 100644 --- a/tests/run/erased-6.scala +++ b/tests/run/erased-6.scala @@ -1,4 +1,4 @@ -//> using options -language:experimental.erasedDefinitions +//> using options -experimental -language:experimental.erasedDefinitions object Test { diff --git a/tests/run/erased-7.scala b/tests/run/erased-7.scala index 080882503b24..c7ec8f41caf3 100644 --- a/tests/run/erased-7.scala +++ b/tests/run/erased-7.scala @@ -1,4 +1,4 @@ -//> using options -language:experimental.erasedDefinitions +//> using options -experimental -language:experimental.erasedDefinitions object Test { diff --git a/tests/run/erased-8.scala b/tests/run/erased-8.scala index ef79e27b75fb..252f3163024a 100644 --- a/tests/run/erased-8.scala +++ b/tests/run/erased-8.scala @@ -1,4 +1,4 @@ -//> using options -language:experimental.erasedDefinitions +//> using options -experimental -language:experimental.erasedDefinitions object Test { diff --git a/tests/run/erased-9.scala b/tests/run/erased-9.scala index 1c38d202640d..0378167c022b 100644 --- a/tests/run/erased-9.scala +++ b/tests/run/erased-9.scala @@ -1,4 +1,4 @@ -//> using options -language:experimental.erasedDefinitions +//> using options -experimental -language:experimental.erasedDefinitions object Test { diff --git a/tests/run/erased-class-are-erased.scala b/tests/run/erased-class-are-erased.scala index 45dc5206e275..57b4fd8ce1aa 100644 --- a/tests/run/erased-class-are-erased.scala +++ b/tests/run/erased-class-are-erased.scala @@ -1,4 +1,4 @@ -//> using options -language:experimental.erasedDefinitions +//> using options -experimental -language:experimental.erasedDefinitions object Test { erased class Erased() { diff --git a/tests/run/erased-frameless.scala b/tests/run/erased-frameless.scala index fe654639492a..637f6ad3cf45 100644 --- a/tests/run/erased-frameless.scala +++ b/tests/run/erased-frameless.scala @@ -1,4 +1,4 @@ -//> using options -language:experimental.erasedDefinitions +//> using options -experimental -language:experimental.erasedDefinitions import scala.annotation.implicitNotFound diff --git a/tests/run/erased-lambdas.scala b/tests/run/erased-lambdas.scala index 9c107e0fa0d4..0c658cd2f288 100644 --- a/tests/run/erased-lambdas.scala +++ b/tests/run/erased-lambdas.scala @@ -1,4 +1,4 @@ -//> using options -language:experimental.erasedDefinitions +//> using options -experimental -language:experimental.erasedDefinitions // scalajs: --skip // lambdas should parse and work diff --git a/tests/run/erased-machine-state.scala b/tests/run/erased-machine-state.scala index c84f1619366d..6d7e2b0373ca 100644 --- a/tests/run/erased-machine-state.scala +++ b/tests/run/erased-machine-state.scala @@ -1,4 +1,4 @@ -//> using options -language:experimental.erasedDefinitions +//> using options -experimental -language:experimental.erasedDefinitions import scala.annotation.implicitNotFound diff --git a/tests/run/erased-poly-ref.scala b/tests/run/erased-poly-ref.scala index 59badb71255d..25259acb7247 100644 --- a/tests/run/erased-poly-ref.scala +++ b/tests/run/erased-poly-ref.scala @@ -1,4 +1,4 @@ -//> using options -language:experimental.erasedDefinitions +//> using options -experimental -language:experimental.erasedDefinitions object Test { diff --git a/tests/run/erased-select-prefix.scala b/tests/run/erased-select-prefix.scala index b877a0d209d7..df1ac4ccfda4 100644 --- a/tests/run/erased-select-prefix.scala +++ b/tests/run/erased-select-prefix.scala @@ -1,4 +1,4 @@ -//> using options -language:experimental.erasedDefinitions +//> using options -experimental -language:experimental.erasedDefinitions object Test { diff --git a/tests/run/erased-value-class.scala b/tests/run/erased-value-class.scala index 37cc233d4aca..b17093b9af79 100644 --- a/tests/run/erased-value-class.scala +++ b/tests/run/erased-value-class.scala @@ -1,4 +1,4 @@ -//> using options -language:experimental.erasedDefinitions +//> using options -experimental -language:experimental.erasedDefinitions object Test { diff --git a/tests/run/generic-java-signatures-erased.scala b/tests/run/generic-java-signatures-erased.scala index 31c6e07599ad..2221784fc586 100644 --- a/tests/run/generic-java-signatures-erased.scala +++ b/tests/run/generic-java-signatures-erased.scala @@ -1,4 +1,4 @@ -//> using options -language:experimental.erasedDefinitions +//> using options -experimental -language:experimental.erasedDefinitions // scalajs: --skip object MyErased { diff --git a/tests/run/genericNumLits.scala b/tests/run/genericNumLits.scala index 7f91ab0b3ef5..101f64e73ecc 100644 --- a/tests/run/genericNumLits.scala +++ b/tests/run/genericNumLits.scala @@ -1,3 +1,5 @@ +//> using options -experimental + import language.experimental.genericNumberLiterals import scala.util.FromDigits object Test extends App { diff --git a/tests/run/hmap-covariant.scala b/tests/run/hmap-covariant.scala index 1d1bace3193a..2a4fe1db5dbf 100644 --- a/tests/run/hmap-covariant.scala +++ b/tests/run/hmap-covariant.scala @@ -1,3 +1,5 @@ +//> using options -experimental + import language.experimental.namedTypeArguments trait Tuple case class TCons[+H, +T <: Tuple](h: H, t: T) extends Tuple diff --git a/tests/run/hmap.scala b/tests/run/hmap.scala index e91e660ae464..2956e58538a6 100644 --- a/tests/run/hmap.scala +++ b/tests/run/hmap.scala @@ -1,3 +1,5 @@ +//> using options -experimental + import language.experimental.namedTypeArguments trait Tuple diff --git a/tests/run/i11996.scala b/tests/run/i11996.scala index 9724e12b575e..80022babe31e 100644 --- a/tests/run/i11996.scala +++ b/tests/run/i11996.scala @@ -1,4 +1,4 @@ -//> using options -language:experimental.erasedDefinitions +//> using options -experimental -language:experimental.erasedDefinitions final class UnivEq[A] diff --git a/tests/run/i13691b.scala b/tests/run/i13691b.scala index 1da726827467..9ece5bc08d01 100644 --- a/tests/run/i13691b.scala +++ b/tests/run/i13691b.scala @@ -1,3 +1,5 @@ +//> using options -experimental + // https://github.com/lampepfl/dotty/issues/13691 import language.experimental.saferExceptions diff --git a/tests/run/i13961a.scala b/tests/run/i13961a.scala index 9d49ab30b0a4..7f8c5afbc6f1 100644 --- a/tests/run/i13961a.scala +++ b/tests/run/i13961a.scala @@ -1,3 +1,5 @@ +//> using options -experimental + import language.experimental.saferExceptions trait Decoder[+T]: diff --git a/tests/run/interleaving.scala b/tests/run/interleaving.scala index 557741032e8a..646ab323ffc1 100644 --- a/tests/run/interleaving.scala +++ b/tests/run/interleaving.scala @@ -1,3 +1,5 @@ +//> using options -experimental + object Test extends App { import scala.language.experimental.clauseInterleaving trait Key { type Value } diff --git a/tests/run/main-annotation-birthday.scala b/tests/run/main-annotation-birthday.scala index 563bb2628e62..60a14bbcb373 100644 --- a/tests/run/main-annotation-birthday.scala +++ b/tests/run/main-annotation-birthday.scala @@ -1,3 +1,4 @@ +//> using options -experimental // scalajs: --skip import scala.annotation.newMain diff --git a/tests/run/main-annotation-dash-dash.scala b/tests/run/main-annotation-dash-dash.scala index bf4a1a4e238c..06d094a5844e 100644 --- a/tests/run/main-annotation-dash-dash.scala +++ b/tests/run/main-annotation-dash-dash.scala @@ -1,3 +1,4 @@ +//> using options -experimental // scalajs: --skip import scala.annotation.newMain diff --git a/tests/run/main-annotation-default-value-1.scala b/tests/run/main-annotation-default-value-1.scala index 40888c947bb6..eb1323c8f03f 100644 --- a/tests/run/main-annotation-default-value-1.scala +++ b/tests/run/main-annotation-default-value-1.scala @@ -1,3 +1,4 @@ +//> using options -experimental // scalajs: --skip import scala.annotation.newMain diff --git a/tests/run/main-annotation-default-value-2.scala b/tests/run/main-annotation-default-value-2.scala index 76ee1bb5cc9f..64111282e023 100644 --- a/tests/run/main-annotation-default-value-2.scala +++ b/tests/run/main-annotation-default-value-2.scala @@ -1,3 +1,4 @@ +//> using options -experimental // scalajs: --skip import scala.annotation.newMain diff --git a/tests/run/main-annotation-example.scala b/tests/run/main-annotation-example.scala index 478ab6baeb4b..43eba0574558 100644 --- a/tests/run/main-annotation-example.scala +++ b/tests/run/main-annotation-example.scala @@ -1,3 +1,4 @@ +//> using options -experimental // scalajs: --skip import scala.annotation.* diff --git a/tests/run/main-annotation-flags.scala b/tests/run/main-annotation-flags.scala index 7e502585489d..507c70574d1b 100644 --- a/tests/run/main-annotation-flags.scala +++ b/tests/run/main-annotation-flags.scala @@ -1,3 +1,4 @@ +//> using options -experimental // scalajs: --skip import scala.annotation.newMain diff --git a/tests/run/main-annotation-help-override.scala b/tests/run/main-annotation-help-override.scala index d174e13ac891..358fbcdbf088 100644 --- a/tests/run/main-annotation-help-override.scala +++ b/tests/run/main-annotation-help-override.scala @@ -1,3 +1,4 @@ +//> using options -experimental // scalajs: --skip import scala.annotation.newMain diff --git a/tests/run/main-annotation-help.scala b/tests/run/main-annotation-help.scala index e7fdf7c362de..3e471d2c7341 100644 --- a/tests/run/main-annotation-help.scala +++ b/tests/run/main-annotation-help.scala @@ -1,3 +1,4 @@ +//> using options -experimental // scalajs: --skip import scala.annotation.newMain diff --git a/tests/run/main-annotation-homemade-annot-1.scala b/tests/run/main-annotation-homemade-annot-1.scala index 3caa2c7e6b00..72b70cc34798 100644 --- a/tests/run/main-annotation-homemade-annot-1.scala +++ b/tests/run/main-annotation-homemade-annot-1.scala @@ -1,3 +1,4 @@ +//> using options -experimental // scalajs: --skip import scala.concurrent._ diff --git a/tests/run/main-annotation-homemade-annot-2.scala b/tests/run/main-annotation-homemade-annot-2.scala index a131aa336d47..16b951716e92 100644 --- a/tests/run/main-annotation-homemade-annot-2.scala +++ b/tests/run/main-annotation-homemade-annot-2.scala @@ -1,3 +1,4 @@ +//> using options -experimental // scalajs: --skip import scala.collection.mutable diff --git a/tests/run/main-annotation-homemade-annot-3.scala b/tests/run/main-annotation-homemade-annot-3.scala index d024ba300665..336bb30372da 100644 --- a/tests/run/main-annotation-homemade-annot-3.scala +++ b/tests/run/main-annotation-homemade-annot-3.scala @@ -1,3 +1,4 @@ +//> using options -experimental // scalajs: --skip import scala.annotation.* diff --git a/tests/run/main-annotation-homemade-annot-4.scala b/tests/run/main-annotation-homemade-annot-4.scala index b4ea510aa677..a24cc339ec7f 100644 --- a/tests/run/main-annotation-homemade-annot-4.scala +++ b/tests/run/main-annotation-homemade-annot-4.scala @@ -1,3 +1,4 @@ +//> using options -experimental // scalajs: --skip import scala.annotation.* diff --git a/tests/run/main-annotation-homemade-annot-5.scala b/tests/run/main-annotation-homemade-annot-5.scala index fc5e34e41d6c..716c3a59e422 100644 --- a/tests/run/main-annotation-homemade-annot-5.scala +++ b/tests/run/main-annotation-homemade-annot-5.scala @@ -1,3 +1,4 @@ +//> using options -experimental // scalajs: --skip import scala.annotation.* diff --git a/tests/run/main-annotation-homemade-annot-6.scala b/tests/run/main-annotation-homemade-annot-6.scala index 39d258803901..c53b359fc513 100644 --- a/tests/run/main-annotation-homemade-annot-6.scala +++ b/tests/run/main-annotation-homemade-annot-6.scala @@ -1,3 +1,4 @@ +//> using options -experimental // scalajs: --skip import scala.annotation.* diff --git a/tests/run/main-annotation-homemade-parser-1.scala b/tests/run/main-annotation-homemade-parser-1.scala index be2adc4a5f72..65b879ae3f5b 100644 --- a/tests/run/main-annotation-homemade-parser-1.scala +++ b/tests/run/main-annotation-homemade-parser-1.scala @@ -1,3 +1,4 @@ +//> using options -experimental // scalajs: --skip import scala.annotation.newMain diff --git a/tests/run/main-annotation-homemade-parser-2.scala b/tests/run/main-annotation-homemade-parser-2.scala index 1a51400d9f37..be2f65930615 100644 --- a/tests/run/main-annotation-homemade-parser-2.scala +++ b/tests/run/main-annotation-homemade-parser-2.scala @@ -1,3 +1,4 @@ +//> using options -experimental // scalajs: --skip import scala.annotation.newMain diff --git a/tests/run/main-annotation-homemade-parser-3.scala b/tests/run/main-annotation-homemade-parser-3.scala index 1e5a4c0dae00..79f6098ce499 100644 --- a/tests/run/main-annotation-homemade-parser-3.scala +++ b/tests/run/main-annotation-homemade-parser-3.scala @@ -1,3 +1,4 @@ +//> using options -experimental // scalajs: --skip import scala.annotation.newMain diff --git a/tests/run/main-annotation-homemade-parser-4.scala b/tests/run/main-annotation-homemade-parser-4.scala index fc087354c16e..7748af1d95db 100644 --- a/tests/run/main-annotation-homemade-parser-4.scala +++ b/tests/run/main-annotation-homemade-parser-4.scala @@ -1,3 +1,4 @@ +//> using options -experimental // scalajs: --skip import scala.annotation.newMain diff --git a/tests/run/main-annotation-homemade-parser-5.scala b/tests/run/main-annotation-homemade-parser-5.scala index f7443f34cab3..a77e2680ee8d 100644 --- a/tests/run/main-annotation-homemade-parser-5.scala +++ b/tests/run/main-annotation-homemade-parser-5.scala @@ -1,3 +1,5 @@ +//> using options -experimental + // scalajs: --skip import scala.annotation.newMain diff --git a/tests/run/main-annotation-multiple.scala b/tests/run/main-annotation-multiple.scala index 62a5fa04cc18..6a5cc213d472 100644 --- a/tests/run/main-annotation-multiple.scala +++ b/tests/run/main-annotation-multiple.scala @@ -1,3 +1,4 @@ +//> using options -experimental // scalajs: --skip import scala.annotation.newMain diff --git a/tests/run/main-annotation-named-params.scala b/tests/run/main-annotation-named-params.scala index 8d677d65978d..afc3f0e6ffbd 100644 --- a/tests/run/main-annotation-named-params.scala +++ b/tests/run/main-annotation-named-params.scala @@ -1,3 +1,4 @@ +//> using options -experimental // scalajs: --skip import scala.annotation.newMain diff --git a/tests/run/main-annotation-newMain.scala b/tests/run/main-annotation-newMain.scala index a28e9d2ab96a..259c4ef25b9f 100644 --- a/tests/run/main-annotation-newMain.scala +++ b/tests/run/main-annotation-newMain.scala @@ -1,3 +1,4 @@ +//> using options -experimental // scalajs: --skip import scala.annotation.* diff --git a/tests/run/main-annotation-no-parameters-no-parens.scala b/tests/run/main-annotation-no-parameters-no-parens.scala index 7ba87c82c745..1a0bc3662807 100644 --- a/tests/run/main-annotation-no-parameters-no-parens.scala +++ b/tests/run/main-annotation-no-parameters-no-parens.scala @@ -1,3 +1,4 @@ +//> using options -experimental // scalajs: --skip import scala.annotation.newMain diff --git a/tests/run/main-annotation-no-parameters.scala b/tests/run/main-annotation-no-parameters.scala index 951254f07bf7..0615ee656ebf 100644 --- a/tests/run/main-annotation-no-parameters.scala +++ b/tests/run/main-annotation-no-parameters.scala @@ -1,3 +1,4 @@ +//> using options -experimental // scalajs: --skip import scala.annotation.newMain diff --git a/tests/run/main-annotation-overload.scala b/tests/run/main-annotation-overload.scala index 939f2044f227..825eb5fc3848 100644 --- a/tests/run/main-annotation-overload.scala +++ b/tests/run/main-annotation-overload.scala @@ -1,3 +1,4 @@ +//> using options -experimental // scalajs: --skip import scala.annotation.newMain diff --git a/tests/run/main-annotation-param-annot-1.scala b/tests/run/main-annotation-param-annot-1.scala index d16e4fac8848..30a1c0f95048 100644 --- a/tests/run/main-annotation-param-annot-1.scala +++ b/tests/run/main-annotation-param-annot-1.scala @@ -1,3 +1,4 @@ +//> using options -experimental // scalajs: --skip import scala.annotation.newMain diff --git a/tests/run/main-annotation-param-annot-2.scala b/tests/run/main-annotation-param-annot-2.scala index 0ee99038910a..aae77f7f9379 100644 --- a/tests/run/main-annotation-param-annot-2.scala +++ b/tests/run/main-annotation-param-annot-2.scala @@ -1,3 +1,4 @@ +//> using options -experimental // scalajs: --skip import scala.annotation.newMain diff --git a/tests/run/main-annotation-param-annot-invalid-params.scala b/tests/run/main-annotation-param-annot-invalid-params.scala index 076c7ff80750..cb66c9262725 100644 --- a/tests/run/main-annotation-param-annot-invalid-params.scala +++ b/tests/run/main-annotation-param-annot-invalid-params.scala @@ -1,3 +1,4 @@ +//> using options -experimental // scalajs: --skip import scala.annotation.newMain diff --git a/tests/run/main-annotation-return-type-1.scala b/tests/run/main-annotation-return-type-1.scala index 641786661613..537a8e567676 100644 --- a/tests/run/main-annotation-return-type-1.scala +++ b/tests/run/main-annotation-return-type-1.scala @@ -1,3 +1,4 @@ +//> using options -experimental // scalajs: --skip import scala.annotation.newMain diff --git a/tests/run/main-annotation-return-type-2.scala b/tests/run/main-annotation-return-type-2.scala index 986c1f0eae94..f5629a44852b 100644 --- a/tests/run/main-annotation-return-type-2.scala +++ b/tests/run/main-annotation-return-type-2.scala @@ -1,3 +1,4 @@ +//> using options -experimental // scalajs: --skip import scala.annotation.newMain diff --git a/tests/run/main-annotation-short-name.scala b/tests/run/main-annotation-short-name.scala index 72e37acdce5c..1efe11fb41b1 100644 --- a/tests/run/main-annotation-short-name.scala +++ b/tests/run/main-annotation-short-name.scala @@ -1,3 +1,4 @@ +//> using options -experimental // scalajs: --skip import scala.annotation.newMain diff --git a/tests/run/main-annotation-simple.scala b/tests/run/main-annotation-simple.scala index 47407c85e36c..9409848ab98c 100644 --- a/tests/run/main-annotation-simple.scala +++ b/tests/run/main-annotation-simple.scala @@ -1,3 +1,4 @@ +//> using options -experimental // scalajs: --skip import scala.annotation.newMain diff --git a/tests/run/main-annotation-top-level.scala b/tests/run/main-annotation-top-level.scala index 52ca42205d9e..7090a43f934b 100644 --- a/tests/run/main-annotation-top-level.scala +++ b/tests/run/main-annotation-top-level.scala @@ -1,3 +1,5 @@ +//> using options -experimental + // scalajs: --skip import scala.annotation.newMain diff --git a/tests/run/main-annotation-types.scala b/tests/run/main-annotation-types.scala index 249c9d010268..4eaa8c400d5b 100644 --- a/tests/run/main-annotation-types.scala +++ b/tests/run/main-annotation-types.scala @@ -1,3 +1,4 @@ +//> using options -experimental // scalajs: --skip import scala.annotation.newMain diff --git a/tests/run/main-annotation-vararg-1.scala b/tests/run/main-annotation-vararg-1.scala index a1b99cd5b150..9efe227eab21 100644 --- a/tests/run/main-annotation-vararg-1.scala +++ b/tests/run/main-annotation-vararg-1.scala @@ -1,3 +1,5 @@ +//> using options -experimental + // scalajs: --skip import scala.annotation.newMain diff --git a/tests/run/main-annotation-vararg-2.scala b/tests/run/main-annotation-vararg-2.scala index becb5958ad8e..2696506550a4 100644 --- a/tests/run/main-annotation-vararg-2.scala +++ b/tests/run/main-annotation-vararg-2.scala @@ -1,3 +1,4 @@ +//> using options -experimental // scalajs: --skip import scala.annotation.newMain diff --git a/tests/run/main-annotation-wrong-param-1.scala b/tests/run/main-annotation-wrong-param-1.scala index ef6ada37b9e3..067c577374a5 100644 --- a/tests/run/main-annotation-wrong-param-1.scala +++ b/tests/run/main-annotation-wrong-param-1.scala @@ -1,3 +1,4 @@ +//> using options -experimental // scalajs: --skip import scala.annotation.newMain diff --git a/tests/run/main-annotation-wrong-param-names.scala b/tests/run/main-annotation-wrong-param-names.scala index c428c955b5cd..4e817acfb805 100644 --- a/tests/run/main-annotation-wrong-param-names.scala +++ b/tests/run/main-annotation-wrong-param-names.scala @@ -1,3 +1,4 @@ +//> using options -experimental // scalajs: --skip import scala.annotation.newMain diff --git a/tests/run/main-annotation-wrong-param-number.scala b/tests/run/main-annotation-wrong-param-number.scala index e607a85e4dc2..795dc26f1555 100644 --- a/tests/run/main-annotation-wrong-param-number.scala +++ b/tests/run/main-annotation-wrong-param-number.scala @@ -1,3 +1,4 @@ +//> using options -experimental // scalajs: --skip import scala.annotation.newMain diff --git a/tests/run/main-annotation-wrong-param-type.scala b/tests/run/main-annotation-wrong-param-type.scala index 2228a8faf7df..c3b44ac85d96 100644 --- a/tests/run/main-annotation-wrong-param-type.scala +++ b/tests/run/main-annotation-wrong-param-type.scala @@ -1,3 +1,4 @@ +//> using options -experimental // scalajs: --skip import scala.annotation.newMain diff --git a/tests/run/main-calculator-example.scala b/tests/run/main-calculator-example.scala index 857792f11967..42ca8a27d383 100644 --- a/tests/run/main-calculator-example.scala +++ b/tests/run/main-calculator-example.scala @@ -1,3 +1,4 @@ +//> using options -experimental // scalajs: --skip sealed trait Expression: diff --git a/tests/run/polymorphic-functions.scala b/tests/run/polymorphic-functions.scala index 16a63b7efe97..ba5f0cf7e9cd 100644 --- a/tests/run/polymorphic-functions.scala +++ b/tests/run/polymorphic-functions.scala @@ -1,3 +1,4 @@ +//> using options -experimental // scalajs: --skip --pending import language.experimental.namedTypeArguments diff --git a/tests/run/saferExceptions.scala b/tests/run/saferExceptions.scala index c28509ddf7be..a833e66273a6 100644 --- a/tests/run/saferExceptions.scala +++ b/tests/run/saferExceptions.scala @@ -1,3 +1,5 @@ +//> using options -experimental + import language.experimental.saferExceptions class Fail extends Exception diff --git a/tests/run/tupled-function-andThen.scala b/tests/run/tupled-function-andThen.scala index 94236e9267e1..5dd0a75d41d3 100644 --- a/tests/run/tupled-function-andThen.scala +++ b/tests/run/tupled-function-andThen.scala @@ -1,3 +1,5 @@ +//> using options -experimental + import scala.util.TupledFunction object Test { diff --git a/tests/run/tupled-function-apply.scala b/tests/run/tupled-function-apply.scala index 7d2162a565ac..8fb68308deb5 100644 --- a/tests/run/tupled-function-apply.scala +++ b/tests/run/tupled-function-apply.scala @@ -1,3 +1,5 @@ +//> using options -experimental + import scala.util.TupledFunction object Test { diff --git a/tests/run/tupled-function-compose.scala b/tests/run/tupled-function-compose.scala index 4cf83563274d..84ca06103537 100644 --- a/tests/run/tupled-function-compose.scala +++ b/tests/run/tupled-function-compose.scala @@ -1,3 +1,5 @@ +//> using options -experimental + import scala.util.TupledFunction object Test { def main(args: Array[String]): Unit = { diff --git a/tests/run/tupled-function-extension-method.scala b/tests/run/tupled-function-extension-method.scala index be5ccbd5ca17..216d91ada605 100644 --- a/tests/run/tupled-function-extension-method.scala +++ b/tests/run/tupled-function-extension-method.scala @@ -1,3 +1,5 @@ +//> using options -experimental + import scala.util.TupledFunction object Test { def main(args: Array[String]): Unit = { diff --git a/tests/run/tupled-function-tupled.scala b/tests/run/tupled-function-tupled.scala index 6e7d94b3ac3d..77ee8f44a0e1 100644 --- a/tests/run/tupled-function-tupled.scala +++ b/tests/run/tupled-function-tupled.scala @@ -1,3 +1,5 @@ +//> using options -experimental + import scala.util.TupledFunction object Test { diff --git a/tests/run/tupled-function-untupled.scala b/tests/run/tupled-function-untupled.scala index e5e3d8c29c3a..3ef86b4cac2e 100644 --- a/tests/run/tupled-function-untupled.scala +++ b/tests/run/tupled-function-untupled.scala @@ -1,3 +1,5 @@ +//> using options -experimental + import scala.util.TupledFunction object Test { def main(args: Array[String]): Unit = {