diff --git a/compiler/test/dotty/tools/utils.scala b/compiler/test/dotty/tools/utils.scala index 75918674146c..8c154a38850d 100644 --- a/compiler/test/dotty/tools/utils.scala +++ b/compiler/test/dotty/tools/utils.scala @@ -80,13 +80,15 @@ def toolArgsFor(tool: ToolName)(lines: List[String]): List[String] = // scalac: arg1 arg2, with alternative opening, optional space, alt names, text that is not */ up to end. // groups are (name, args) private val toolArg = raw"(?://|/\*| \*) ?(?i:(${ToolName.values.mkString("|")})):((?:[^*]|\*(?!/))*)".r.unanchored +private val directiveOptionsArg = raw"//> using options (.*)".r.unanchored // Inspect the lines for compiler options of the form // `// scalac: args`, `/* scalac: args`, ` * scalac: args`. // If args string ends in close comment, stop at the `*` `/`. // Returns all the matches by the regex. def toolArgsParse(lines: List[String]): List[(String,String)] = - lines.flatMap { case toolArg(name, args) => List((name, args)) case _ => Nil } + lines.flatMap { case toolArg(name, args) => List((name, args)) case _ => Nil } ++ + lines.flatMap { case directiveOptionsArg(args) => List(("scalac", args)) case _ => Nil } import org.junit.Test import org.junit.Assert._ diff --git a/tests/explicit-nulls/neg-patmat/match-pat.scala b/tests/explicit-nulls/neg-patmat/match-pat.scala index e285163340ae..1b93267d8fe3 100644 --- a/tests/explicit-nulls/neg-patmat/match-pat.scala +++ b/tests/explicit-nulls/neg-patmat/match-pat.scala @@ -1,4 +1,4 @@ -// scalac: -Xfatal-warnings +//> using options -Xfatal-warnings class Foo { diff --git a/tests/explicit-nulls/pos/i14682.scala b/tests/explicit-nulls/pos/i14682.scala index 0c9224e7122a..318de6094a88 100644 --- a/tests/explicit-nulls/pos/i14682.scala +++ b/tests/explicit-nulls/pos/i14682.scala @@ -1,4 +1,4 @@ -// scalac: -Ysafe-init +//> using options -Ysafe-init class C1: sealed abstract class Name { diff --git a/tests/explicit-nulls/pos/i14947.scala b/tests/explicit-nulls/pos/i14947.scala index 6238077a0693..f7a8ff0ff28f 100644 --- a/tests/explicit-nulls/pos/i14947.scala +++ b/tests/explicit-nulls/pos/i14947.scala @@ -1,4 +1,4 @@ -// scalac: -Ytest-pickler -Xprint-types +//> using options -Ytest-pickler -Xprint-types class B: def g: String | Null = ??? diff --git a/tests/explicit-nulls/pos/match-pat.scala b/tests/explicit-nulls/pos/match-pat.scala index c4e13bbdacdc..33013d1865fd 100644 --- a/tests/explicit-nulls/pos/match-pat.scala +++ b/tests/explicit-nulls/pos/match-pat.scala @@ -1,4 +1,4 @@ -// scalac: -Xfatal-warnings +//> using options -Xfatal-warnings // Ensure we don't get "the type test for argType cannot be checked at runtime" warning diff --git a/tests/explicit-nulls/pos/unsafe-match-null-pat.scala b/tests/explicit-nulls/pos/unsafe-match-null-pat.scala index 3c1eaf922550..ff31642a4027 100644 --- a/tests/explicit-nulls/pos/unsafe-match-null-pat.scala +++ b/tests/explicit-nulls/pos/unsafe-match-null-pat.scala @@ -1,4 +1,4 @@ -// scalac: -Xfatal-warnings +//> using options -Xfatal-warnings import scala.language.unsafeNulls diff --git a/tests/neg-custom-args/wildcards.scala b/tests/neg-custom-args/wildcards.scala index cbe9c6936f16..c734e2d046b5 100644 --- a/tests/neg-custom-args/wildcards.scala +++ b/tests/neg-custom-args/wildcards.scala @@ -1,4 +1,4 @@ -// scalac: -source future -deprecation -Xfatal-warnings +//> using options -source future -deprecation -Xfatal-warnings object Test { val xs: List[_] = List(1, 2, 3) // error diff --git a/tests/neg-macros/i16355a.scala b/tests/neg-macros/i16355a.scala index 8870b7777263..80a23aa7d7ee 100644 --- a/tests/neg-macros/i16355a.scala +++ b/tests/neg-macros/i16355a.scala @@ -1,4 +1,3 @@ -//> using scala "3.2.1" import scala.quoted.Expr import scala.quoted.Type import scala.quoted.quotes diff --git a/tests/neg-macros/i9570.scala b/tests/neg-macros/i9570.scala index 977cea3bf147..9242fd2e9bbd 100644 --- a/tests/neg-macros/i9570.scala +++ b/tests/neg-macros/i9570.scala @@ -1,4 +1,4 @@ -// scalac: -Xfatal-warnings +//> using options -Xfatal-warnings import scala.quoted.* diff --git a/tests/neg-macros/macro-deprecation.scala b/tests/neg-macros/macro-deprecation.scala index ab27f935649a..ad1cdda001bb 100644 --- a/tests/neg-macros/macro-deprecation.scala +++ b/tests/neg-macros/macro-deprecation.scala @@ -1,4 +1,4 @@ -// scalac: -Xfatal-warnings -deprecation +//> using options -Xfatal-warnings -deprecation import scala.quoted.* diff --git a/tests/neg-macros/macro-experimental.scala b/tests/neg-macros/macro-experimental.scala index ce1f768c8629..eaa822d4b541 100644 --- a/tests/neg-macros/macro-experimental.scala +++ b/tests/neg-macros/macro-experimental.scala @@ -1,4 +1,4 @@ -// scalac: -Yno-experimental +//> using options -Yno-experimental import scala.quoted.* import scala.annotation.experimental diff --git a/tests/neg-scalajs/enumeration-warnings.scala b/tests/neg-scalajs/enumeration-warnings.scala index 8f1e17475d0b..b48ffc9500e3 100644 --- a/tests/neg-scalajs/enumeration-warnings.scala +++ b/tests/neg-scalajs/enumeration-warnings.scala @@ -1,4 +1,4 @@ -// scalac: -Xfatal-warnings +//> using options -Xfatal-warnings class UnableToTransformValue extends Enumeration { val a = { diff --git a/tests/neg/14034.scala b/tests/neg/14034.scala index 756dd4a13e9e..bdb09a011777 100644 --- a/tests/neg/14034.scala +++ b/tests/neg/14034.scala @@ -1,4 +1,4 @@ -// scalac: -Yno-experimental +//> using options -Yno-experimental import annotation.experimental diff --git a/tests/neg/14034b.scala b/tests/neg/14034b.scala index c299b1dfe5d7..84f9ab3579c8 100644 --- a/tests/neg/14034b.scala +++ b/tests/neg/14034b.scala @@ -1,4 +1,4 @@ -// scalac: -Xfatal-warnings -deprecation +//> using options -Xfatal-warnings -deprecation @deprecated trait Exp @deprecated val exp = 1 diff --git a/tests/neg/15981.scala b/tests/neg/15981.scala index efbad2570e7b..5aba3555c010 100644 --- a/tests/neg/15981.scala +++ b/tests/neg/15981.scala @@ -1,4 +1,4 @@ -// scalac: -Werror +//> using options -Werror val _ = locally{ sealed abstract class PosInt(val value: Int) { override def equals(any: Any): Boolean = any.isInstanceOf[PosInt] // error diff --git a/tests/neg/17284.scala b/tests/neg/17284.scala index 177926de7287..8f588233245a 100644 --- a/tests/neg/17284.scala +++ b/tests/neg/17284.scala @@ -1,4 +1,4 @@ -// scalac: -Werror -explain +//> using options -Werror -explain def test = 451.synchronized {} // error diff --git a/tests/neg/18031.scala b/tests/neg/18031.scala index 39b39a03d003..a91ad8bfc66d 100644 --- a/tests/neg/18031.scala +++ b/tests/neg/18031.scala @@ -1,4 +1,4 @@ -// scalac: -source:future +//> using options -source:future object A: val x, y, z = 0 diff --git a/tests/neg/IsInstanceOfClassTag.scala b/tests/neg/IsInstanceOfClassTag.scala index 45d1c5550dff..65a7ecb031b2 100644 --- a/tests/neg/IsInstanceOfClassTag.scala +++ b/tests/neg/IsInstanceOfClassTag.scala @@ -1,4 +1,4 @@ -// scalac: -Xfatal-warnings +//> using options -Xfatal-warnings import scala.reflect.ClassTag diff --git a/tests/neg/IsInstanceOfClassTag2.scala b/tests/neg/IsInstanceOfClassTag2.scala index ee1f9535a226..9246c7fca84d 100644 --- a/tests/neg/IsInstanceOfClassTag2.scala +++ b/tests/neg/IsInstanceOfClassTag2.scala @@ -1,4 +1,4 @@ -// scalac: -Xfatal-warnings +//> using options -Xfatal-warnings import scala.reflect.TypeTest diff --git a/tests/neg/adhoc-extension/B.scala b/tests/neg/adhoc-extension/B.scala index 6b13e66b3ada..2343a9bc0060 100644 --- a/tests/neg/adhoc-extension/B.scala +++ b/tests/neg/adhoc-extension/B.scala @@ -1,4 +1,4 @@ -// scalac: -source future -feature -Xfatal-warnings +//> using options -source future -feature -Xfatal-warnings package adhoc class B extends A // error: adhoc-extension (under -strict -feature -Xfatal-warnings) diff --git a/tests/neg/autoTuplingTestb.scala b/tests/neg/autoTuplingTestb.scala index c12e68e2c5b4..be890508fad9 100644 --- a/tests/neg/autoTuplingTestb.scala +++ b/tests/neg/autoTuplingTestb.scala @@ -1,4 +1,4 @@ -// scalac: -language:noAutoTupling +//> using options -language:noAutoTupling object autoTupling { diff --git a/tests/neg/avoid-warn-deprecation.scala b/tests/neg/avoid-warn-deprecation.scala index 4d3638a821b1..45baf7addb86 100644 --- a/tests/neg/avoid-warn-deprecation.scala +++ b/tests/neg/avoid-warn-deprecation.scala @@ -1,4 +1,4 @@ -// scalac: -Xfatal-warnings -feature +//> using options -Xfatal-warnings -feature object A { @deprecated("use bar instead of this one", "0.2.3") diff --git a/tests/neg/by-name.scala b/tests/neg/by-name.scala index 7c31ffffa493..74b003f56044 100644 --- a/tests/neg/by-name.scala +++ b/tests/neg/by-name.scala @@ -1,4 +1,4 @@ -// scalac: -language:experimental.erasedDefinitions +//> using options -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 f9fa71361b40..b1b375d12f55 100644 --- a/tests/neg/capt-wf.scala +++ b/tests/neg/capt-wf.scala @@ -1,4 +1,4 @@ -// scalac: -language:experimental.captureChecking -Xfatal-warnings +//> using options -language:experimental.captureChecking -Xfatal-warnings class C type Cap = C^ diff --git a/tests/neg/classtag-typetest/3_1-migration.scala b/tests/neg/classtag-typetest/3_1-migration.scala index 369c530ad04c..41e0537a6dc1 100644 --- a/tests/neg/classtag-typetest/3_1-migration.scala +++ b/tests/neg/classtag-typetest/3_1-migration.scala @@ -1,4 +1,4 @@ -// scalac: -Xfatal-warnings +//> using options -Xfatal-warnings import scala.language.`future-migration` import scala.reflect.ClassTag diff --git a/tests/neg/classtag-typetest/3_1.scala b/tests/neg/classtag-typetest/3_1.scala index 5aa1759097cb..d9101ff2ae57 100644 --- a/tests/neg/classtag-typetest/3_1.scala +++ b/tests/neg/classtag-typetest/3_1.scala @@ -1,4 +1,4 @@ -// scalac: -Xfatal-warnings +//> using options -Xfatal-warnings import scala.language.future import scala.reflect.ClassTag diff --git a/tests/neg/constructor-proxy-shadowing.scala b/tests/neg/constructor-proxy-shadowing.scala index 0e2cccfc057a..fafc9c112c49 100644 --- a/tests/neg/constructor-proxy-shadowing.scala +++ b/tests/neg/constructor-proxy-shadowing.scala @@ -1,4 +1,4 @@ -// scalac: -explain +//> using options -explain object Test extends App { def A22(s: String): String = s diff --git a/tests/neg/convertible.scala b/tests/neg/convertible.scala index 45b0af88dab1..e72de452f41d 100644 --- a/tests/neg/convertible.scala +++ b/tests/neg/convertible.scala @@ -1,4 +1,4 @@ -// scalac: -Xfatal-warnings -feature +//> using options -Xfatal-warnings -feature import language.experimental.into diff --git a/tests/neg/deptypes.scala b/tests/neg/deptypes.scala index 0232c5ab2651..39b1e42ccbca 100644 --- a/tests/neg/deptypes.scala +++ b/tests/neg/deptypes.scala @@ -1,4 +1,4 @@ -// scalac: -language:experimental.dependent +//> using options -language:experimental.dependent type Vec[T] = (n: Int) =>> Array[T] // error: not yet implemented diff --git a/tests/neg/enum-variance.scala b/tests/neg/enum-variance.scala index 1bf4df5ac8dd..ae6693ad94cc 100644 --- a/tests/neg/enum-variance.scala +++ b/tests/neg/enum-variance.scala @@ -1,4 +1,4 @@ -// scalac: -Xfatal-warnings +//> using options -Xfatal-warnings enum View[-T]: case Refl(f: T => T) // error: enum case Refl requires explicit declaration of type T diff --git a/tests/neg/erased-1.scala b/tests/neg/erased-1.scala index 178d0a4ff3fe..62a1024e80f5 100644 --- a/tests/neg/erased-1.scala +++ b/tests/neg/erased-1.scala @@ -1,4 +1,4 @@ -// scalac: -language:experimental.erasedDefinitions +//> using options -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 785c0cc8b848..02e4b56e11ac 100644 --- a/tests/neg/erased-2.scala +++ b/tests/neg/erased-2.scala @@ -1,4 +1,4 @@ -// scalac: -language:experimental.erasedDefinitions +//> using options -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 e701ba8ff577..bf2f1d21435e 100644 --- a/tests/neg/erased-24.scala +++ b/tests/neg/erased-24.scala @@ -1,4 +1,4 @@ -// scalac: -language:experimental.erasedDefinitions +//> using options -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 365dc1be7744..5c6a31860b11 100644 --- a/tests/neg/erased-3.scala +++ b/tests/neg/erased-3.scala @@ -1,4 +1,4 @@ -// scalac: -language:experimental.erasedDefinitions +//> using options -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 ee379e9085eb..46b101acafd4 100644 --- a/tests/neg/erased-4.scala +++ b/tests/neg/erased-4.scala @@ -1,4 +1,4 @@ -// scalac: -language:experimental.erasedDefinitions +//> using options -language:experimental.erasedDefinitions object Test { diff --git a/tests/neg/erased-5.scala b/tests/neg/erased-5.scala index 34040844e101..2d88b9f90d9f 100644 --- a/tests/neg/erased-5.scala +++ b/tests/neg/erased-5.scala @@ -1,4 +1,4 @@ -// scalac: -language:experimental.erasedDefinitions +//> using options -language:experimental.erasedDefinitions object Test { diff --git a/tests/neg/erased-6.scala b/tests/neg/erased-6.scala index 53c720aead21..4585ab876b3d 100644 --- a/tests/neg/erased-6.scala +++ b/tests/neg/erased-6.scala @@ -1,4 +1,4 @@ -// scalac: -language:experimental.erasedDefinitions +//> using options -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 f59c64c07bb1..2deee749ed3d 100644 --- a/tests/neg/erased-args-lifted.scala +++ b/tests/neg/erased-args-lifted.scala @@ -1,4 +1,4 @@ -// scalac: -language:experimental.erasedDefinitions +//> using options -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 4392b7bbd3c9..5026ca3f1856 100644 --- a/tests/neg/erased-assign.scala +++ b/tests/neg/erased-assign.scala @@ -1,4 +1,4 @@ -// scalac: -language:experimental.erasedDefinitions +//> using options -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 0a9ec2cd8257..5fdda47d5257 100644 --- a/tests/neg/erased-case-class.scala +++ b/tests/neg/erased-case-class.scala @@ -1,3 +1,3 @@ -// scalac: -language:experimental.erasedDefinitions +//> using options -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 684f096d72a1..a57b9b1c149e 100644 --- a/tests/neg/erased-def-rhs.scala +++ b/tests/neg/erased-def-rhs.scala @@ -1,4 +1,4 @@ -// scalac: -language:experimental.erasedDefinitions +//> using options -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 3511a561884c..d879f0ebf2e7 100644 --- a/tests/neg/erased-if-else.scala +++ b/tests/neg/erased-if-else.scala @@ -1,4 +1,4 @@ -// scalac: -language:experimental.erasedDefinitions +//> using options -language:experimental.erasedDefinitions object Test { var b = true diff --git a/tests/neg/erased-implicit.scala b/tests/neg/erased-implicit.scala index 9eb31b54f7cc..28fca7427942 100644 --- a/tests/neg/erased-implicit.scala +++ b/tests/neg/erased-implicit.scala @@ -1,4 +1,4 @@ -// scalac: -language:experimental.erasedDefinitions +//> using options -language:experimental.erasedDefinitions object Test { diff --git a/tests/neg/erased-in-tuples.scala b/tests/neg/erased-in-tuples.scala index 52c48b33a6c9..d1567c8e3a47 100644 --- a/tests/neg/erased-in-tuples.scala +++ b/tests/neg/erased-in-tuples.scala @@ -1,4 +1,4 @@ -// scalac: -language:experimental.erasedDefinitions +//> using options -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 39fb5eedbf0f..271f87cc2cf0 100644 --- a/tests/neg/erased-lazy-val.scala +++ b/tests/neg/erased-lazy-val.scala @@ -1,4 +1,4 @@ -// scalac: -language:experimental.erasedDefinitions +//> using options -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 49d708642916..f6f2acd48766 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 @@ -// scalac: -language:experimental.erasedDefinitions +//> using options -language:experimental.erasedDefinitions import scala.compiletime.* diff --git a/tests/neg/erased-match.scala b/tests/neg/erased-match.scala index fc61dca8497b..d05a0c7e0f03 100644 --- a/tests/neg/erased-match.scala +++ b/tests/neg/erased-match.scala @@ -1,4 +1,4 @@ -// scalac: -language:experimental.erasedDefinitions +//> using options -language:experimental.erasedDefinitions object Test { var b = true diff --git a/tests/neg/erased-object.scala b/tests/neg/erased-object.scala index 98db2492eb42..6f616d02010f 100644 --- a/tests/neg/erased-object.scala +++ b/tests/neg/erased-object.scala @@ -1,3 +1,3 @@ -// scalac: -language:experimental.erasedDefinitions +//> using options -language:experimental.erasedDefinitions erased object Test // error diff --git a/tests/neg/erased-path.scala b/tests/neg/erased-path.scala index e8523374b5c2..ece90e563483 100644 --- a/tests/neg/erased-path.scala +++ b/tests/neg/erased-path.scala @@ -1,4 +1,4 @@ -// scalac: -language:experimental.erasedDefinitions +//> using options -language:experimental.erasedDefinitions trait Sys { type X } diff --git a/tests/neg/erased-pathdep-1.scala b/tests/neg/erased-pathdep-1.scala index 03dc1c7a0778..422ceb5e37fe 100644 --- a/tests/neg/erased-pathdep-1.scala +++ b/tests/neg/erased-pathdep-1.scala @@ -1,4 +1,4 @@ -// scalac: -language:experimental.erasedDefinitions +//> using options -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 2e900ab7cd91..0b50acbf3b30 100644 --- a/tests/neg/erased-pathdep-2.scala +++ b/tests/neg/erased-pathdep-2.scala @@ -1,4 +1,4 @@ -// scalac: -language:experimental.erasedDefinitions +//> using options -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 9dab55292161..f1abdef1df22 100644 --- a/tests/neg/erased-return.scala +++ b/tests/neg/erased-return.scala @@ -1,4 +1,4 @@ -// scalac: -language:experimental.erasedDefinitions +//> using options -language:experimental.erasedDefinitions object Test { var b = true diff --git a/tests/neg/erased-singleton.scala b/tests/neg/erased-singleton.scala index 982b185f5471..5ffa78e24b07 100644 --- a/tests/neg/erased-singleton.scala +++ b/tests/neg/erased-singleton.scala @@ -1,4 +1,4 @@ -// scalac: -language:experimental.erasedDefinitions +//> using options -language:experimental.erasedDefinitions trait Sys diff --git a/tests/neg/erased-try.scala b/tests/neg/erased-try.scala index a3df0c584a9c..0de3732a4e6e 100644 --- a/tests/neg/erased-try.scala +++ b/tests/neg/erased-try.scala @@ -1,4 +1,4 @@ -// scalac: -language:experimental.erasedDefinitions +//> using options -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 132565f98d5b..4df6780ff2f4 100644 --- a/tests/neg/erased-type.scala +++ b/tests/neg/erased-type.scala @@ -1,4 +1,4 @@ -// scalac: -language:experimental.erasedDefinitions +//> using options -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 b05015db497a..f8bb838e4298 100644 --- a/tests/neg/erased-val-rhs.scala +++ b/tests/neg/erased-val-rhs.scala @@ -1,4 +1,4 @@ -// scalac: -language:experimental.erasedDefinitions +//> using options -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 2f63c726c967..81dfeeee3e1c 100644 --- a/tests/neg/erased-value-class.scala +++ b/tests/neg/erased-value-class.scala @@ -1,4 +1,4 @@ -// scalac: -language:experimental.erasedDefinitions +//> using options -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 abead3a2a0e1..51c9221e3bd9 100644 --- a/tests/neg/erased-var.scala +++ b/tests/neg/erased-var.scala @@ -1,4 +1,4 @@ -// scalac: -language:experimental.erasedDefinitions +//> using options -language:experimental.erasedDefinitions object Test { erased var i: Int = 1 // error diff --git a/tests/neg/erasedValueb.scala b/tests/neg/erasedValueb.scala index b4d24c584487..5c1f1d359e93 100644 --- a/tests/neg/erasedValueb.scala +++ b/tests/neg/erasedValueb.scala @@ -1,4 +1,4 @@ -// scalac: -language:experimental.erasedDefinitions +//> using options -language:experimental.erasedDefinitions import scala.compiletime.erasedValue object Test { diff --git a/tests/neg/experimental-2.scala b/tests/neg/experimental-2.scala index 2b56af377c89..f2d0262d83f5 100644 --- a/tests/neg/experimental-2.scala +++ b/tests/neg/experimental-2.scala @@ -1,4 +1,4 @@ -// scalac: -Yno-experimental +//> using options -Yno-experimental class Test7 { import scala.language.experimental diff --git a/tests/neg/experimental-erased.scala b/tests/neg/experimental-erased.scala index a26c3a5b04c1..3619d0059a95 100644 --- a/tests/neg/experimental-erased.scala +++ b/tests/neg/experimental-erased.scala @@ -1,4 +1,4 @@ -// scalac: -Yno-experimental +//> 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 70089afb764f..3a672ac65a22 100644 --- a/tests/neg/experimental-imports.scala +++ b/tests/neg/experimental-imports.scala @@ -1,4 +1,4 @@ -// scalac: -Yno-experimental +//> using options -Yno-experimental import annotation.experimental diff --git a/tests/neg/experimental-nested-imports-2.scala b/tests/neg/experimental-nested-imports-2.scala index 6e84f4114bb4..4aac719a81d6 100644 --- a/tests/neg/experimental-nested-imports-2.scala +++ b/tests/neg/experimental-nested-imports-2.scala @@ -1,4 +1,4 @@ -// scalac: -Yno-experimental +//> using options -Yno-experimental import annotation.experimental diff --git a/tests/neg/experimental-nested-imports-3.scala b/tests/neg/experimental-nested-imports-3.scala index bd048d199c73..39b548b2586b 100644 --- a/tests/neg/experimental-nested-imports-3.scala +++ b/tests/neg/experimental-nested-imports-3.scala @@ -1,4 +1,4 @@ -// scalac: -Yno-experimental +//> using options -Yno-experimental import annotation.experimental diff --git a/tests/neg/experimental-nested-imports.scala b/tests/neg/experimental-nested-imports.scala index a7949becbe83..91fe3bfeb27b 100644 --- a/tests/neg/experimental-nested-imports.scala +++ b/tests/neg/experimental-nested-imports.scala @@ -1,4 +1,4 @@ -// scalac: -Yno-experimental +//> using options -Yno-experimental import annotation.experimental diff --git a/tests/neg/experimental-package-imports.scala b/tests/neg/experimental-package-imports.scala index 8ad986e3a61f..7a4b04606b9d 100644 --- a/tests/neg/experimental-package-imports.scala +++ b/tests/neg/experimental-package-imports.scala @@ -1,4 +1,4 @@ -// scalac: -Yno-experimental +//> using options -Yno-experimental import annotation.experimental diff --git a/tests/neg/experimental.scala b/tests/neg/experimental.scala index e11ba17f3c69..efca9a26ec14 100644 --- a/tests/neg/experimental.scala +++ b/tests/neg/experimental.scala @@ -1,4 +1,4 @@ -// scalac: -Yno-experimental +//> using options -Yno-experimental class Test0 { import language.experimental.namedTypeArguments // error diff --git a/tests/neg/experimentalAnnot.scala b/tests/neg/experimentalAnnot.scala index 4e43418e4fc0..e50d9165b5a4 100644 --- a/tests/neg/experimentalAnnot.scala +++ b/tests/neg/experimentalAnnot.scala @@ -1,4 +1,4 @@ -// scalac: -Yno-experimental +//> using options -Yno-experimental import scala.annotation.experimental diff --git a/tests/neg/experimentalCaseClass.scala b/tests/neg/experimentalCaseClass.scala index 211517a2e4f8..383824954041 100644 --- a/tests/neg/experimentalCaseClass.scala +++ b/tests/neg/experimentalCaseClass.scala @@ -1,4 +1,4 @@ -// scalac: -Yno-experimental +//> using options -Yno-experimental import scala.annotation.experimental diff --git a/tests/neg/experimentalDefaultParams.scala b/tests/neg/experimentalDefaultParams.scala index ab396b45fc00..fb9ffa282e60 100644 --- a/tests/neg/experimentalDefaultParams.scala +++ b/tests/neg/experimentalDefaultParams.scala @@ -1,4 +1,4 @@ -// scalac: -Yno-experimental +//> using options -Yno-experimental import scala.annotation.experimental diff --git a/tests/neg/experimentalEnum.scala b/tests/neg/experimentalEnum.scala index 0317ce828f2e..14ced7ca22bb 100644 --- a/tests/neg/experimentalEnum.scala +++ b/tests/neg/experimentalEnum.scala @@ -1,4 +1,4 @@ -// scalac: -Yno-experimental +//> using options -Yno-experimental import scala.annotation.experimental diff --git a/tests/neg/experimentalErased.scala b/tests/neg/experimentalErased.scala index 49663dd9d8fa..99de8048c261 100644 --- a/tests/neg/experimentalErased.scala +++ b/tests/neg/experimentalErased.scala @@ -1,4 +1,4 @@ -// scalac: -Yno-experimental +//> using options -Yno-experimental import language.experimental.erasedDefinitions import annotation.experimental diff --git a/tests/neg/experimentalInline.scala b/tests/neg/experimentalInline.scala index 367dcaba29c5..b837ad498492 100644 --- a/tests/neg/experimentalInline.scala +++ b/tests/neg/experimentalInline.scala @@ -1,4 +1,4 @@ -// scalac: -Yno-experimental +//> using options -Yno-experimental import scala.annotation.experimental diff --git a/tests/neg/experimentalInline2.scala b/tests/neg/experimentalInline2.scala index b2fbce922099..8bf6a82fba2e 100644 --- a/tests/neg/experimentalInline2.scala +++ b/tests/neg/experimentalInline2.scala @@ -1,4 +1,4 @@ -// scalac: -Yno-experimental +//> using options -Yno-experimental import scala.annotation.experimental diff --git a/tests/neg/experimentalMembers.scala b/tests/neg/experimentalMembers.scala index e7d3f62de5e7..fe4adbfcf44d 100644 --- a/tests/neg/experimentalMembers.scala +++ b/tests/neg/experimentalMembers.scala @@ -1,4 +1,4 @@ -// scalac: -Yno-experimental +//> using options -Yno-experimental import scala.annotation.experimental diff --git a/tests/neg/experimentalOverride.scala b/tests/neg/experimentalOverride.scala index 984af350bb1a..adc8b919dc6b 100644 --- a/tests/neg/experimentalOverride.scala +++ b/tests/neg/experimentalOverride.scala @@ -1,4 +1,4 @@ -// scalac: -Yno-experimental +//> using options -Yno-experimental import scala.annotation.experimental diff --git a/tests/neg/experimentalRHS.scala b/tests/neg/experimentalRHS.scala index ebd145a7bf80..cffa35ed4ba9 100644 --- a/tests/neg/experimentalRHS.scala +++ b/tests/neg/experimentalRHS.scala @@ -1,4 +1,4 @@ -// scalac: -Yno-experimental +//> using options -Yno-experimental import scala.annotation.experimental diff --git a/tests/neg/experimentalSam.scala b/tests/neg/experimentalSam.scala index 108a1c633227..ab86cabc6816 100644 --- a/tests/neg/experimentalSam.scala +++ b/tests/neg/experimentalSam.scala @@ -1,4 +1,4 @@ -// scalac: -Yno-experimental +//> using options -Yno-experimental import scala.annotation.experimental diff --git a/tests/neg/experimentalSignature.scala b/tests/neg/experimentalSignature.scala index 1307bf31d219..479f9140d0a0 100644 --- a/tests/neg/experimentalSignature.scala +++ b/tests/neg/experimentalSignature.scala @@ -1,4 +1,4 @@ -// scalac: -Yno-experimental +//> using options -Yno-experimental import scala.annotation.experimental diff --git a/tests/neg/experimentalTerms.scala b/tests/neg/experimentalTerms.scala index e24e35369ca2..10776e78bae7 100644 --- a/tests/neg/experimentalTerms.scala +++ b/tests/neg/experimentalTerms.scala @@ -1,4 +1,4 @@ -// scalac: -Yno-experimental +//> using options -Yno-experimental import scala.annotation.experimental diff --git a/tests/neg/experimentalTests.scala b/tests/neg/experimentalTests.scala index db90214e9577..a45809c099c4 100644 --- a/tests/neg/experimentalTests.scala +++ b/tests/neg/experimentalTests.scala @@ -1,4 +1,4 @@ -// scalac: -Yno-experimental +//> using options -Yno-experimental import scala.annotation.experimental diff --git a/tests/neg/experimentalType.scala b/tests/neg/experimentalType.scala index 015b3be1f8fa..22bdecf415e3 100644 --- a/tests/neg/experimentalType.scala +++ b/tests/neg/experimentalType.scala @@ -1,4 +1,4 @@ -// scalac: -Yno-experimental +//> using options -Yno-experimental import scala.annotation.experimental diff --git a/tests/neg/experimentalTypeRHS.scala b/tests/neg/experimentalTypeRHS.scala index e902119ead56..f5801ea2f11d 100644 --- a/tests/neg/experimentalTypeRHS.scala +++ b/tests/neg/experimentalTypeRHS.scala @@ -1,4 +1,4 @@ -// scalac: -Yno-experimental +//> using options -Yno-experimental import scala.annotation.experimental diff --git a/tests/neg/experimentalTypes2.scala b/tests/neg/experimentalTypes2.scala index 5ce60d4b2c66..3d042792c4de 100644 --- a/tests/neg/experimentalTypes2.scala +++ b/tests/neg/experimentalTypes2.scala @@ -1,4 +1,4 @@ -// scalac: -Yno-experimental +//> using options -Yno-experimental import scala.annotation.experimental diff --git a/tests/neg/experimentalUnapply.scala b/tests/neg/experimentalUnapply.scala index 1fe4a272795e..049577bf63fd 100644 --- a/tests/neg/experimentalUnapply.scala +++ b/tests/neg/experimentalUnapply.scala @@ -1,4 +1,4 @@ -// scalac: -Yno-experimental +//> using options -Yno-experimental import scala.annotation.experimental diff --git a/tests/neg/feature-shadowing.scala b/tests/neg/feature-shadowing.scala index 7534f99f73aa..16286d5eea87 100644 --- a/tests/neg/feature-shadowing.scala +++ b/tests/neg/feature-shadowing.scala @@ -1,4 +1,4 @@ -// scalac: -Xfatal-warnings -feature +//> using options -Xfatal-warnings -feature import language.implicitConversions given Conversion[Int, String] = _.toString diff --git a/tests/neg/filtering-fors.scala b/tests/neg/filtering-fors.scala index b274cf8b06cb..7d998a37f057 100644 --- a/tests/neg/filtering-fors.scala +++ b/tests/neg/filtering-fors.scala @@ -1,4 +1,4 @@ -// scalac: -Xfatal-warnings +//> using options -Xfatal-warnings object Test { diff --git a/tests/neg/gadt-contradictory-pattern.scala b/tests/neg/gadt-contradictory-pattern.scala index 9b466b079072..6fbd06120a48 100644 --- a/tests/neg/gadt-contradictory-pattern.scala +++ b/tests/neg/gadt-contradictory-pattern.scala @@ -1,4 +1,4 @@ -// scalac: -Xfatal-warnings -Wimplausible-patterns +//> using options -Xfatal-warnings -Wimplausible-patterns object Test { sealed abstract class Foo[T] case object Bar1 extends Foo[Int] diff --git a/tests/neg/hidden-type-errors/Test.scala b/tests/neg/hidden-type-errors/Test.scala index dabbc5a3cb95..69516252e486 100644 --- a/tests/neg/hidden-type-errors/Test.scala +++ b/tests/neg/hidden-type-errors/Test.scala @@ -1,4 +1,4 @@ -// scalac: -explain +//> using options -explain package t12717 diff --git a/tests/neg/i10247.scala b/tests/neg/i10247.scala index ad38d60f7322..fc6268720a6d 100644 --- a/tests/neg/i10247.scala +++ b/tests/neg/i10247.scala @@ -1,4 +1,4 @@ -// scalac: -Xfatal-warnings -deprecation +//> using options -Xfatal-warnings -deprecation def usered = Color.Red // error: value Red is deprecated diff --git a/tests/neg/i10930.scala b/tests/neg/i10930.scala index ba60a15af911..5f8a0ca1ba76 100644 --- a/tests/neg/i10930.scala +++ b/tests/neg/i10930.scala @@ -1,4 +1,4 @@ -// scalac: -Xfatal-warnings +//> using options -Xfatal-warnings import language.future @main def Test = diff --git a/tests/neg/i10994.scala b/tests/neg/i10994.scala index 56d63be8635a..f5f237f22dd6 100644 --- a/tests/neg/i10994.scala +++ b/tests/neg/i10994.scala @@ -1,4 +1,4 @@ -// scalac: -Xfatal-warnings +//> using options -Xfatal-warnings def foo = true match case (b: Boolean): Boolean => () // error diff --git a/tests/neg/i11022.scala b/tests/neg/i11022.scala index a904195f3725..14bc600666f9 100644 --- a/tests/neg/i11022.scala +++ b/tests/neg/i11022.scala @@ -1,4 +1,4 @@ -// scalac: -Xfatal-warnings -deprecation +//> using options -Xfatal-warnings -deprecation @deprecated("no CaseClass") case class CaseClass(rgb: Int): diff --git a/tests/neg/i11097.scala b/tests/neg/i11097.scala index 3a9544a25866..149fe89249c8 100644 --- a/tests/neg/i11097.scala +++ b/tests/neg/i11097.scala @@ -1,4 +1,4 @@ -// scalac: -Xfatal-warnings +//> using options -Xfatal-warnings @main def test: Unit = { class C { type T1; type T2 } diff --git a/tests/neg/i11333.scala b/tests/neg/i11333.scala index c43ddbab6f34..bbdcceaf7e1e 100644 --- a/tests/neg/i11333.scala +++ b/tests/neg/i11333.scala @@ -1,4 +1,4 @@ -// scalac: -Xfatal-warnings +//> using options -Xfatal-warnings class C: val f1: Float = 123456789 // error diff --git a/tests/neg/i11344.scala b/tests/neg/i11344.scala index 79e237304ce5..0602fe14a995 100644 --- a/tests/neg/i11344.scala +++ b/tests/neg/i11344.scala @@ -1,4 +1,4 @@ -// scalac: -Xfatal-warnings -deprecation +//> using options -Xfatal-warnings -deprecation trait Pet(val name: String, rest: Int): def f(suffix: String) = s"$name$suffix$rest" diff --git a/tests/neg/i11637.scala b/tests/neg/i11637.scala index 67af8ec1db07..4721e373f236 100644 --- a/tests/neg/i11637.scala +++ b/tests/neg/i11637.scala @@ -1,4 +1,4 @@ -// scalac: -explain +//> using options -explain // This is OK object test1: diff --git a/tests/neg/i11963a.scala b/tests/neg/i11963a.scala index 94f1bf458d51..0eb2f557624f 100644 --- a/tests/neg/i11963a.scala +++ b/tests/neg/i11963a.scala @@ -1,3 +1,3 @@ -// scalac: -Xfatal-warnings +//> using options -Xfatal-warnings open trait Foo // error diff --git a/tests/neg/i11963b.scala b/tests/neg/i11963b.scala index d0741bc4b64a..76097b225896 100644 --- a/tests/neg/i11963b.scala +++ b/tests/neg/i11963b.scala @@ -1,3 +1,3 @@ -// scalac: -Xfatal-warnings +//> using options -Xfatal-warnings open abstract class Foo // error diff --git a/tests/neg/i11963c.scala b/tests/neg/i11963c.scala index c6ba7df590a9..f58f68c72368 100644 --- a/tests/neg/i11963c.scala +++ b/tests/neg/i11963c.scala @@ -1,4 +1,4 @@ -// scalac: -Xfatal-warnings +//> using options -Xfatal-warnings object Test { def foo: Any = { diff --git a/tests/neg/i12188/Test.scala b/tests/neg/i12188/Test.scala index 0d3ca16ccf8d..66864438694e 100644 --- a/tests/neg/i12188/Test.scala +++ b/tests/neg/i12188/Test.scala @@ -1,4 +1,4 @@ -// scalac: -Xfatal-warnings +//> using options -Xfatal-warnings sealed trait P case class PC1(a: String) extends P diff --git a/tests/neg/i12253.scala b/tests/neg/i12253.scala index 645f38d527b4..540ff8ef6d5b 100644 --- a/tests/neg/i12253.scala +++ b/tests/neg/i12253.scala @@ -1,4 +1,4 @@ -// scalac: -Xfatal-warnings +//> using options -Xfatal-warnings import scala.quoted.{given, *} import deriving.*, compiletime.* diff --git a/tests/neg/i12597.scala b/tests/neg/i12597.scala index d780bea85bc8..b8859a0ae991 100644 --- a/tests/neg/i12597.scala +++ b/tests/neg/i12597.scala @@ -1,4 +1,4 @@ -// scalac: -Xfatal-warnings -deprecation +//> using options -Xfatal-warnings -deprecation @main def Test = val a: IArray[Int] = IArray(2) diff --git a/tests/neg/i12682.scala b/tests/neg/i12682.scala index 0b37816ef0df..a1850534b4c3 100644 --- a/tests/neg/i12682.scala +++ b/tests/neg/i12682.scala @@ -1,4 +1,4 @@ -// scalac: -explain +//> using options -explain object C: def m(x: Int) = 1 diff --git a/tests/neg/i13011.scala b/tests/neg/i13011.scala index 196ae620a3f9..c0541aeb7f8e 100644 --- a/tests/neg/i13011.scala +++ b/tests/neg/i13011.scala @@ -1,4 +1,4 @@ -// scalac: -Xfatal-warnings +//> using options -Xfatal-warnings class i13011 { lazy implicit val simple1: String = simple1 // error diff --git a/tests/neg/i13026.scala b/tests/neg/i13026.scala index 573f4c96d4db..847f5e7d8897 100644 --- a/tests/neg/i13026.scala +++ b/tests/neg/i13026.scala @@ -1,4 +1,4 @@ -// scalac: -print-lines +//> using options -print-lines val x: Int = "not an int" // error val y: Int = "not an int" // error diff --git a/tests/neg/i13091.scala b/tests/neg/i13091.scala index e5725258c89d..208d05d6886d 100644 --- a/tests/neg/i13091.scala +++ b/tests/neg/i13091.scala @@ -1,4 +1,4 @@ -// scalac: -Yno-experimental +//> using options -Yno-experimental import annotation.experimental diff --git a/tests/neg/i13440.scala b/tests/neg/i13440.scala index 629b12bcdc72..443215c621ef 100644 --- a/tests/neg/i13440.scala +++ b/tests/neg/i13440.scala @@ -1,4 +1,4 @@ -// scalac: -Xfatal-warnings +//> using options -Xfatal-warnings import language.`3.0-migration` diff --git a/tests/neg/i13542.scala b/tests/neg/i13542.scala index 8d816cbf5fd5..c0feb88b556d 100644 --- a/tests/neg/i13542.scala +++ b/tests/neg/i13542.scala @@ -1,4 +1,4 @@ -// scalac: -Xfatal-warnings +//> using options -Xfatal-warnings import scala.language.implicitConversions diff --git a/tests/neg/i13838.scala b/tests/neg/i13838.scala index 3def03bbfd55..2b43ce1c254b 100644 --- a/tests/neg/i13838.scala +++ b/tests/neg/i13838.scala @@ -1,4 +1,4 @@ -// scalac: -Ximplicit-search-limit 1000 +//> using options -Ximplicit-search-limit 1000 implicit def catsSyntaxEq[A: Eq](a: A): Foo[A] = ??? diff --git a/tests/neg/i13848.scala b/tests/neg/i13848.scala index affc0082c2c8..fcc519c47592 100644 --- a/tests/neg/i13848.scala +++ b/tests/neg/i13848.scala @@ -1,4 +1,4 @@ -// scalac: -Yno-experimental +//> using options -Yno-experimental import annotation.experimental diff --git a/tests/neg/i13946/BadPrinter.scala b/tests/neg/i13946/BadPrinter.scala index de42924e294d..46913d2c2805 100644 --- a/tests/neg/i13946/BadPrinter.scala +++ b/tests/neg/i13946/BadPrinter.scala @@ -1,4 +1,4 @@ -// scalac: -Xfatal-warnings -feature +//> using options -Xfatal-warnings -feature // in BadPrinter.scala import language.future diff --git a/tests/neg/i14386.scala b/tests/neg/i14386.scala index c25b6ba9f3c1..be0b2497ed5f 100644 --- a/tests/neg/i14386.scala +++ b/tests/neg/i14386.scala @@ -1,4 +1,4 @@ -// scalac: -Werror +//> using options -Werror def logLevelDetail(level: Int): String = s"""$level diff --git a/tests/neg/i14705.scala b/tests/neg/i14705.scala index 489cb9067648..9ffb4443416e 100644 --- a/tests/neg/i14705.scala +++ b/tests/neg/i14705.scala @@ -1,4 +1,4 @@ -// scalac: -Xfatal-warnings +//> using options -Xfatal-warnings val n = Nil val b = n.head.isInstanceOf[String] // error diff --git a/tests/neg/i14721.scala b/tests/neg/i14721.scala index 804fe2e13829..46786f04558b 100644 --- a/tests/neg/i14721.scala +++ b/tests/neg/i14721.scala @@ -1,4 +1,4 @@ -// scalac: -Xfatal-warnings +//> using options -Xfatal-warnings class C: def op: Unit = println("op") diff --git a/tests/neg/i15381.scala b/tests/neg/i15381.scala index c3e1cc771521..a0328931b36e 100644 --- a/tests/neg/i15381.scala +++ b/tests/neg/i15381.scala @@ -1,4 +1,4 @@ -// scalac: -Vprint:parser +//> using options -Vprint:parser case class $[A](value: A) diff --git a/tests/neg/i15474.scala b/tests/neg/i15474.scala index 9d879f886e75..8edf97a1e55a 100644 --- a/tests/neg/i15474.scala +++ b/tests/neg/i15474.scala @@ -1,4 +1,4 @@ -// scalac: -Xfatal-warnings +//> using options -Xfatal-warnings import scala.language.implicitConversions diff --git a/tests/neg/i15503-scala2/scala2-t11681.scala b/tests/neg/i15503-scala2/scala2-t11681.scala index 85f50428a0e6..2436668e0c9c 100644 --- a/tests/neg/i15503-scala2/scala2-t11681.scala +++ b/tests/neg/i15503-scala2/scala2-t11681.scala @@ -1,4 +1,4 @@ -// scalac: -Xfatal-warnings -Wunused:params +//> using options -Xfatal-warnings -Wunused:params // import Answers._ diff --git a/tests/neg/i15503a.scala b/tests/neg/i15503a.scala index 2dc1fa40f293..b5f17a1e2f52 100644 --- a/tests/neg/i15503a.scala +++ b/tests/neg/i15503a.scala @@ -1,4 +1,4 @@ -// scalac: -Xfatal-warnings -Wunused:imports +//> using options -Xfatal-warnings -Wunused:imports object FooUnused: diff --git a/tests/neg/i15503b.scala b/tests/neg/i15503b.scala index 4a0728128bc5..4dc10e12606d 100644 --- a/tests/neg/i15503b.scala +++ b/tests/neg/i15503b.scala @@ -1,4 +1,4 @@ -// scalac: -Xfatal-warnings -Wunused:locals +//> using options -Xfatal-warnings -Wunused:locals val a = 1 // OK diff --git a/tests/neg/i15503c.scala b/tests/neg/i15503c.scala index 37f88de84aa9..b93ce8825114 100644 --- a/tests/neg/i15503c.scala +++ b/tests/neg/i15503c.scala @@ -1,4 +1,4 @@ -// scalac: -Xfatal-warnings -Wunused:privates +//> using options -Xfatal-warnings -Wunused:privates trait C class A: self: C => // OK diff --git a/tests/neg/i15503d.scala b/tests/neg/i15503d.scala index 16323e0eb5d2..c43dc07c638e 100644 --- a/tests/neg/i15503d.scala +++ b/tests/neg/i15503d.scala @@ -1,4 +1,4 @@ -// scalac: -Xfatal-warnings -Wunused:unsafe-warn-patvars +//> using options -Xfatal-warnings -Wunused:unsafe-warn-patvars // todo : change to :patvars sealed trait Calc diff --git a/tests/neg/i15503e.scala b/tests/neg/i15503e.scala index 3ec8f5e72d06..f3214e7b24e6 100644 --- a/tests/neg/i15503e.scala +++ b/tests/neg/i15503e.scala @@ -1,4 +1,4 @@ -// scalac: -Xfatal-warnings -Wunused:explicits +//> using options -Xfatal-warnings -Wunused:explicits object Foo { /* This goes around the "trivial method" detection */ diff --git a/tests/neg/i15503f.scala b/tests/neg/i15503f.scala index 046b0d634f7a..08520d149b95 100644 --- a/tests/neg/i15503f.scala +++ b/tests/neg/i15503f.scala @@ -1,4 +1,4 @@ -// scalac: -Xfatal-warnings -Wunused:implicits +//> using options -Xfatal-warnings -Wunused:implicits /* This goes around the "trivial method" detection */ val default_int = 1 diff --git a/tests/neg/i15503g.scala b/tests/neg/i15503g.scala index f77ef4cd49dc..4da98a8d43f2 100644 --- a/tests/neg/i15503g.scala +++ b/tests/neg/i15503g.scala @@ -1,4 +1,4 @@ -// scalac: -Xfatal-warnings -Wunused:params +//> using options -Xfatal-warnings -Wunused:params /* This goes around the "trivial method" detection */ object Foo { diff --git a/tests/neg/i15503h.scala b/tests/neg/i15503h.scala index c7719fa4d26f..cef1f6cf566f 100644 --- a/tests/neg/i15503h.scala +++ b/tests/neg/i15503h.scala @@ -1,4 +1,4 @@ -// scalac: -Xfatal-warnings -Wunused:linted +//> using options -Xfatal-warnings -Wunused:linted import collection.mutable.Set // error diff --git a/tests/neg/i15503i.scala b/tests/neg/i15503i.scala index ca0bb2cf1714..d415c95a701a 100644 --- a/tests/neg/i15503i.scala +++ b/tests/neg/i15503i.scala @@ -1,4 +1,4 @@ -// scalac: -Xfatal-warnings -Wunused:all +//> using options -Xfatal-warnings -Wunused:all import collection.mutable.{Map => MutMap} // error import collection.mutable.Set // error diff --git a/tests/neg/i15503j.scala b/tests/neg/i15503j.scala index d00e2bf7fac2..66140934abc1 100644 --- a/tests/neg/i15503j.scala +++ b/tests/neg/i15503j.scala @@ -1,4 +1,4 @@ -// scalac: -Xfatal-warnings -Wunused:strict-no-implicit-warn +//> using options -Xfatal-warnings -Wunused:strict-no-implicit-warn package foo.unused.strict.test: package a: diff --git a/tests/neg/i15575.scala b/tests/neg/i15575.scala index b26d17369873..8d32258352b5 100644 --- a/tests/neg/i15575.scala +++ b/tests/neg/i15575.scala @@ -1,4 +1,4 @@ -// scalac: -explain +//> using options -explain object Test1: def foo[T >: Any]: Unit = () diff --git a/tests/neg/i15662.scala b/tests/neg/i15662.scala index e3030f6adc0e..1b6070f26e00 100644 --- a/tests/neg/i15662.scala +++ b/tests/neg/i15662.scala @@ -1,4 +1,4 @@ -// scalac: -Xfatal-warnings +//> using options -Xfatal-warnings case class Composite[T](v: T) diff --git a/tests/neg/i15893.scala b/tests/neg/i15893.scala index 98973c334bdc..d66da9ebec8b 100644 --- a/tests/neg/i15893.scala +++ b/tests/neg/i15893.scala @@ -1,4 +1,4 @@ -// scalac: -Xfatal-warnings +//> using options -Xfatal-warnings sealed trait NatT case class Zero() extends NatT diff --git a/tests/neg/i16438.scala b/tests/neg/i16438.scala index 33873b13384b..a2b88080c2cd 100644 --- a/tests/neg/i16438.scala +++ b/tests/neg/i16438.scala @@ -1,4 +1,4 @@ -// scalac: -Ysafe-init +//> using options -Ysafe-init trait ATrait(val string: String, val int: Int) trait AnotherTrait( override val string: String, override val int: Int) extends ATrait case class ACaseClass(override val string: String) extends AnotherTrait(string, 3) // error diff --git a/tests/neg/i16601a.scala b/tests/neg/i16601a.scala index ab785ce14de2..232f9c1c9d03 100644 --- a/tests/neg/i16601a.scala +++ b/tests/neg/i16601a.scala @@ -1,3 +1,3 @@ -// scalac: -explain +//> using options -explain @main def Test: Unit = new concurrent.ExecutionContext // error \ No newline at end of file diff --git a/tests/neg/i16639a.scala b/tests/neg/i16639a.scala index b45c11c412be..7f380e2129db 100644 --- a/tests/neg/i16639a.scala +++ b/tests/neg/i16639a.scala @@ -1,4 +1,4 @@ -// scalac: -Xfatal-warnings -Wunused:all +//> using options -Xfatal-warnings -Wunused:all // class Bippy(a: Int, b: Int) { private def this(c: Int) = this(c, c) // warn /Dotty:NoWarn diff --git a/tests/neg/i16649-refutable.scala b/tests/neg/i16649-refutable.scala index f6e649c624ef..8caac5b2576a 100644 --- a/tests/neg/i16649-refutable.scala +++ b/tests/neg/i16649-refutable.scala @@ -1,4 +1,4 @@ -// scalac: -Xfatal-warnings +//> using options -Xfatal-warnings import quoted.* diff --git a/tests/neg/i16728.scala b/tests/neg/i16728.scala index d79ba16b3954..b76bb03fa14a 100644 --- a/tests/neg/i16728.scala +++ b/tests/neg/i16728.scala @@ -1,4 +1,4 @@ -// scalac: -Xfatal-warnings +//> using options -Xfatal-warnings class A[T] { class X { diff --git a/tests/neg/i16876/Test.scala b/tests/neg/i16876/Test.scala index ea8f46909db5..2dd6bfb34421 100644 --- a/tests/neg/i16876/Test.scala +++ b/tests/neg/i16876/Test.scala @@ -1,4 +1,4 @@ -// scalac: -Xfatal-warnings -Wunused:all +//> using options -Xfatal-warnings -Wunused:all object Foo { private def myMethod(a: Int, b: Int, c: Int) = adder // ok diff --git a/tests/neg/i16888.scala b/tests/neg/i16888.scala index 8b4e94eb58da..b6e89275cf9c 100644 --- a/tests/neg/i16888.scala +++ b/tests/neg/i16888.scala @@ -1,3 +1,3 @@ -// scalac: -explain +//> using options -explain def test = summon[scala.quoted.Quotes] // error diff --git a/tests/neg/i16930.scala b/tests/neg/i16930.scala index 816fba7f4dcf..c7af60161424 100644 --- a/tests/neg/i16930.scala +++ b/tests/neg/i16930.scala @@ -1,4 +1,4 @@ -// scalac: -Xfatal-warnings -Wunused:imports +//> using options -Xfatal-warnings -Wunused:imports trait Outer: trait Used diff --git a/tests/neg/i17266.scala b/tests/neg/i17266.scala index 166ed2239875..439abafc44a1 100644 --- a/tests/neg/i17266.scala +++ b/tests/neg/i17266.scala @@ -1,4 +1,4 @@ -// scalac: -Werror -explain +//> using options -Werror -explain def test1 = synchronized { // error diff --git a/tests/neg/i17292.scala b/tests/neg/i17292.scala index fdab30779cdb..9cf7fc7b1c30 100644 --- a/tests/neg/i17292.scala +++ b/tests/neg/i17292.scala @@ -1,4 +1,4 @@ -// scalac: -Yno-experimental +//> using options -Yno-experimental import annotation.experimental diff --git a/tests/neg/i17292b.scala b/tests/neg/i17292b.scala index 2111001e28f9..b89a64439699 100644 --- a/tests/neg/i17292b.scala +++ b/tests/neg/i17292b.scala @@ -1,4 +1,4 @@ -// scalac: -Yno-experimental +//> using options -Yno-experimental import annotation.experimental type A[T] = Int diff --git a/tests/neg/i17314b.scala b/tests/neg/i17314b.scala index f1eb82865c3b..9e89fecde935 100644 --- a/tests/neg/i17314b.scala +++ b/tests/neg/i17314b.scala @@ -1,4 +1,4 @@ -// scalac: -Xfatal-warnings -Wunused:all +//> using options -Xfatal-warnings -Wunused:all package foo: class Foo[T] diff --git a/tests/neg/i17335.scala b/tests/neg/i17335.scala index 8dd4d90721f2..b22ece6e42bf 100644 --- a/tests/neg/i17335.scala +++ b/tests/neg/i17335.scala @@ -1,4 +1,4 @@ -// scalac: -Xfatal-warnings -Wunused:all +//> using options -Xfatal-warnings -Wunused:all def aMethod() = doStuff { (x) => x } // error diff --git a/tests/neg/i17738-toplevel-infix.scala b/tests/neg/i17738-toplevel-infix.scala index a67ef9618446..b57ac0bb150c 100644 --- a/tests/neg/i17738-toplevel-infix.scala +++ b/tests/neg/i17738-toplevel-infix.scala @@ -1,4 +1,4 @@ -// scalac: -explain +//> using options -explain infix type A[b, a] = Nothing infix type B[b, a] = b match { diff --git a/tests/neg/i2333.scala b/tests/neg/i2333.scala index 92def60e6fe4..67cddbc73f48 100644 --- a/tests/neg/i2333.scala +++ b/tests/neg/i2333.scala @@ -1,4 +1,4 @@ -// scalac: -Xfatal-warnings -deprecation +//> using options -Xfatal-warnings -deprecation @deprecated("bla", "2.11.0") class Foo { println("") diff --git a/tests/neg/i2642.scala b/tests/neg/i2642.scala index c3fe2a680bdc..b9cde8b1b450 100644 --- a/tests/neg/i2642.scala +++ b/tests/neg/i2642.scala @@ -1,4 +1,4 @@ -// scalac: -language:experimental.erasedDefinitions +//> using options -language:experimental.erasedDefinitions object Foo { type X = (using ) => Int // error: an identifier expected, but ')' found diff --git a/tests/neg/i2673.scala b/tests/neg/i2673.scala index 2d017fe7c02d..62c787fa00fb 100644 --- a/tests/neg/i2673.scala +++ b/tests/neg/i2673.scala @@ -1,4 +1,4 @@ -// scalac: -Xfatal-warnings +//> using options -Xfatal-warnings package Foos diff --git a/tests/neg/i2673b.scala b/tests/neg/i2673b.scala index 8d5ea8491a6c..26e09ec3297e 100644 --- a/tests/neg/i2673b.scala +++ b/tests/neg/i2673b.scala @@ -1,4 +1,4 @@ -// scalac: -Xfatal-warnings +//> using options -Xfatal-warnings package Foos diff --git a/tests/neg/i2673c.scala b/tests/neg/i2673c.scala index f8f1786cd9f6..575d8c25d9e0 100644 --- a/tests/neg/i2673c.scala +++ b/tests/neg/i2673c.scala @@ -1,4 +1,4 @@ -// scalac: -Xfatal-warnings +//> using options -Xfatal-warnings package Foos diff --git a/tests/neg/i3246.scala b/tests/neg/i3246.scala index 2c4261317730..07f1480a14ab 100644 --- a/tests/neg/i3246.scala +++ b/tests/neg/i3246.scala @@ -1,4 +1,4 @@ -// scalac: -source 3.0-migration +//> using options -source 3.0-migration class Test { def foo(x: Int) = 1 diff --git a/tests/neg/i3561.scala b/tests/neg/i3561.scala index 2f87bfa0288a..862e65f3c2f7 100644 --- a/tests/neg/i3561.scala +++ b/tests/neg/i3561.scala @@ -1,4 +1,4 @@ -// scalac: -Xfatal-warnings +//> using options -Xfatal-warnings class Test { val Constant = 'Q' // OK if final diff --git a/tests/neg/i4008.scala b/tests/neg/i4008.scala index 5b5464a7a40a..5b851c987e37 100644 --- a/tests/neg/i4008.scala +++ b/tests/neg/i4008.scala @@ -1,4 +1,4 @@ -// scalac: -Xfatal-warnings +//> using options -Xfatal-warnings // ===== Template annotations ===== diff --git a/tests/neg/i4060.scala b/tests/neg/i4060.scala index 6d467d414666..ba641d633d3c 100644 --- a/tests/neg/i4060.scala +++ b/tests/neg/i4060.scala @@ -1,4 +1,4 @@ -// scalac: -language:experimental.erasedDefinitions +//> using options -language:experimental.erasedDefinitions // See https://github.com/lampepfl/dotty/issues/4060#issuecomment-445808377 diff --git a/tests/neg/i4364.scala b/tests/neg/i4364.scala index ed47c41eec40..85dca443f6d4 100644 --- a/tests/neg/i4364.scala +++ b/tests/neg/i4364.scala @@ -1,4 +1,4 @@ -// scalac: -Xfatal-warnings +//> using options -Xfatal-warnings object Test { def foo(c: java.util.function.Consumer[Integer]) = c.accept(0) diff --git a/tests/neg/i4812.scala b/tests/neg/i4812.scala index fa38980f78d1..8d518107825c 100644 --- a/tests/neg/i4812.scala +++ b/tests/neg/i4812.scala @@ -1,4 +1,4 @@ -// scalac: -Werror +//> using options -Werror object Test: var prev: Any = _ diff --git a/tests/neg/i4936b.scala b/tests/neg/i4936b.scala index 33b13c1eeec1..58c240e92309 100644 --- a/tests/neg/i4936b.scala +++ b/tests/neg/i4936b.scala @@ -1,3 +1,3 @@ -// scalac: -Xfatal-warnings +//> using options -Xfatal-warnings final object Foo // error diff --git a/tests/neg/i4986b.scala b/tests/neg/i4986b.scala index a563e0b43991..c726e40fd4d8 100644 --- a/tests/neg/i4986b.scala +++ b/tests/neg/i4986b.scala @@ -1,4 +1,4 @@ -// scalac: -Xfatal-warnings +//> using options -Xfatal-warnings import scala.annotation.implicitNotFound diff --git a/tests/neg/i4986d.scala b/tests/neg/i4986d.scala index 47769efd46ba..909221bea5f0 100644 --- a/tests/neg/i4986d.scala +++ b/tests/neg/i4986d.scala @@ -1,4 +1,4 @@ -// scalac: -Xfatal-warnings +//> using options -Xfatal-warnings trait Foo[A] diff --git a/tests/neg/i5013.scala b/tests/neg/i5013.scala index a6987b457147..adf09e2cf3be 100644 --- a/tests/neg/i5013.scala +++ b/tests/neg/i5013.scala @@ -1,4 +1,4 @@ -// scalac: -Xfatal-warnings +//> using options -Xfatal-warnings class Foo { diff --git a/tests/neg/i5013b.scala b/tests/neg/i5013b.scala index 554ec7417ef9..7ccaf47c12f3 100644 --- a/tests/neg/i5013b.scala +++ b/tests/neg/i5013b.scala @@ -1,4 +1,4 @@ -// scalac: -Xfatal-warnings +//> using options -Xfatal-warnings class Foo { diff --git a/tests/neg/i5077.scala b/tests/neg/i5077.scala index 4f685f28880f..64de24bfd669 100644 --- a/tests/neg/i5077.scala +++ b/tests/neg/i5077.scala @@ -1,4 +1,4 @@ -// scalac: -Xfatal-warnings -Wimplausible-patterns +//> using options -Xfatal-warnings -Wimplausible-patterns trait Is[A] case object IsInt extends Is[Int] case object IsString extends Is[String] diff --git a/tests/neg/i5525b.scala b/tests/neg/i5525b.scala index 6b8295c397bb..d51564ad52c1 100644 --- a/tests/neg/i5525b.scala +++ b/tests/neg/i5525b.scala @@ -1,4 +1,4 @@ -// scalac: -language:experimental.erasedDefinitions +//> using options -language:experimental.erasedDefinitions erased enum Foo6 {} // error: only access modifiers allowed diff --git a/tests/neg/i6190b.scala b/tests/neg/i6190b.scala index 00ad4dfd920b..42270c1a984c 100644 --- a/tests/neg/i6190b.scala +++ b/tests/neg/i6190b.scala @@ -1,4 +1,4 @@ -// scalac: -Xfatal-warnings +//> using options -Xfatal-warnings case class Rule(name: String) diff --git a/tests/neg/i7314.scala b/tests/neg/i7314.scala index b68a7bebc080..b865f2ad881b 100644 --- a/tests/neg/i7314.scala +++ b/tests/neg/i7314.scala @@ -1,4 +1,4 @@ -// scalac: -Xfatal-warnings -source future +//> using options -Xfatal-warnings -source future @main def Test = // conversion out of the opaque type: diff --git a/tests/neg/i7821.scala b/tests/neg/i7821.scala index 71619a2342b5..5275c06e487f 100644 --- a/tests/neg/i7821.scala +++ b/tests/neg/i7821.scala @@ -1,4 +1,4 @@ -// scalac: -Xfatal-warnings +//> using options -Xfatal-warnings object XObject { opaque type X = Int diff --git a/tests/neg/i7821b.scala b/tests/neg/i7821b.scala index d4d562509e63..f82a38d259e1 100644 --- a/tests/neg/i7821b.scala +++ b/tests/neg/i7821b.scala @@ -1,4 +1,4 @@ -// scalac: -Xfatal-warnings +//> using options -Xfatal-warnings object Test { diff --git a/tests/neg/i8427.scala b/tests/neg/i8427.scala index 03176269c62b..3db449bed41c 100644 --- a/tests/neg/i8427.scala +++ b/tests/neg/i8427.scala @@ -1,4 +1,4 @@ -// scalac: -Xfatal-warnings +//> using options -Xfatal-warnings @SerialVersionUID(1L) // error trait T diff --git a/tests/neg/i8681.scala b/tests/neg/i8681.scala index 8531240d4ebe..4d91509eb0d3 100644 --- a/tests/neg/i8681.scala +++ b/tests/neg/i8681.scala @@ -1,4 +1,4 @@ -// scalac: -Xfatal-warnings +//> using options -Xfatal-warnings case class A(a: Int) case class B(b: Int) diff --git a/tests/neg/i8711.scala b/tests/neg/i8711.scala index 10a02ee402c6..2647e20fe03b 100644 --- a/tests/neg/i8711.scala +++ b/tests/neg/i8711.scala @@ -1,4 +1,4 @@ -// scalac: -Xfatal-warnings +//> using options -Xfatal-warnings class A class B diff --git a/tests/neg/i8781b.scala b/tests/neg/i8781b.scala index 0cb800ecdbc7..7c9b074e1be7 100644 --- a/tests/neg/i8781b.scala +++ b/tests/neg/i8781b.scala @@ -1,4 +1,4 @@ -// scalac: -Xfatal-warnings +//> using options -Xfatal-warnings object Test: diff --git a/tests/neg/i8922b.scala b/tests/neg/i8922b.scala index b3c0bcadd73f..9e615a8d5b58 100644 --- a/tests/neg/i8922b.scala +++ b/tests/neg/i8922b.scala @@ -1,4 +1,4 @@ -// scalac: -Xfatal-warnings +//> using options -Xfatal-warnings case class Token(tokenType: TokenType, lexeme: StringV, line: IntV) diff --git a/tests/neg/i9166.scala b/tests/neg/i9166.scala index fab2ee3df93d..b9644bf56f71 100644 --- a/tests/neg/i9166.scala +++ b/tests/neg/i9166.scala @@ -1,4 +1,4 @@ -// scalac: -Xfatal-warnings -Wimplausible-patterns +//> using options -Xfatal-warnings -Wimplausible-patterns object UnitTest extends App { def foo(m: Unit) = m match { case runtime.BoxedUnit.UNIT => println("ok") // error diff --git a/tests/neg/i9168.scala b/tests/neg/i9168.scala index 8d90e2d2a0e7..ed8bd4750972 100644 --- a/tests/neg/i9168.scala +++ b/tests/neg/i9168.scala @@ -1,3 +1,3 @@ -// scalac: -Xfatal-warnings +//> using options -Xfatal-warnings def g: Int = try 42 finally ; // error diff --git a/tests/neg/i9241.scala b/tests/neg/i9241.scala index fe8cc22d8b96..e7c959fc9ee2 100644 --- a/tests/neg/i9241.scala +++ b/tests/neg/i9241.scala @@ -1,4 +1,4 @@ -// scalac: -Xfatal-warnings +//> using options -Xfatal-warnings class Foo { def unary_~() : Foo = this // error diff --git a/tests/neg/i9266.scala b/tests/neg/i9266.scala index 2f00660dae7a..e6f8db7417c7 100644 --- a/tests/neg/i9266.scala +++ b/tests/neg/i9266.scala @@ -1,4 +1,4 @@ -// scalac: -Xfatal-warnings +//> using options -Xfatal-warnings import language.`future-migration` diff --git a/tests/neg/i9408a.scala b/tests/neg/i9408a.scala index 0d5f4b45e000..594417ec3215 100644 --- a/tests/neg/i9408a.scala +++ b/tests/neg/i9408a.scala @@ -1,4 +1,4 @@ -// scalac: -Xfatal-warnings +//> using options -Xfatal-warnings import language.`3.0-migration` import scala.language.implicitConversions diff --git a/tests/neg/i9408b/Test_2.scala b/tests/neg/i9408b/Test_2.scala index 8f86e28c30ca..6b3cbbafcb0e 100644 --- a/tests/neg/i9408b/Test_2.scala +++ b/tests/neg/i9408b/Test_2.scala @@ -1,4 +1,4 @@ -// scalac: -Xfatal-warnings +//> using options -Xfatal-warnings import language.`3.0-migration` import scala.language.implicitConversions diff --git a/tests/neg/i9517.scala b/tests/neg/i9517.scala index e764cd253e71..2e63ec5fe5f8 100644 --- a/tests/neg/i9517.scala +++ b/tests/neg/i9517.scala @@ -1,4 +1,4 @@ -// scalac: -Xprint-types +//> using options -Xprint-types def test():Unit = foo({ case 1 => 10 }) // error def foo(x: Any): Boolean = true diff --git a/tests/neg/i9685bis.scala b/tests/neg/i9685bis.scala index 7f95e4fe3ff7..0a3e245fe738 100644 --- a/tests/neg/i9685bis.scala +++ b/tests/neg/i9685bis.scala @@ -1,4 +1,4 @@ -// scalac: -source future +//> using options -source future package foo diff --git a/tests/neg/i9740.scala b/tests/neg/i9740.scala index da7ddc9e27ed..6222298df48b 100644 --- a/tests/neg/i9740.scala +++ b/tests/neg/i9740.scala @@ -1,4 +1,4 @@ -// scalac: -Xfatal-warnings -Wimplausible-patterns +//> using options -Xfatal-warnings -Wimplausible-patterns abstract class RecoveryCompleted object RecoveryCompleted extends RecoveryCompleted diff --git a/tests/neg/i9740b.scala b/tests/neg/i9740b.scala index 8d39fa0c1810..dcd9a1d6a474 100644 --- a/tests/neg/i9740b.scala +++ b/tests/neg/i9740b.scala @@ -1,4 +1,4 @@ -// scalac: -Xfatal-warnings -Wimplausible-patterns +//> using options -Xfatal-warnings -Wimplausible-patterns enum Recovery: case RecoveryCompleted diff --git a/tests/neg/i9740c.scala b/tests/neg/i9740c.scala index 68232fe91b5c..c6a3a1380f1d 100644 --- a/tests/neg/i9740c.scala +++ b/tests/neg/i9740c.scala @@ -1,4 +1,4 @@ -// scalac: -Xfatal-warnings -Wimplausible-patterns +//> using options -Xfatal-warnings -Wimplausible-patterns sealed trait Exp[T] case class IntExp(x: Int) extends Exp[Int] case class StrExp(x: String) extends Exp[String] diff --git a/tests/neg/i9740d.scala b/tests/neg/i9740d.scala index f39a3372dca1..6f3cc3be02e2 100644 --- a/tests/neg/i9740d.scala +++ b/tests/neg/i9740d.scala @@ -1,4 +1,4 @@ -// scalac: -Xfatal-warnings -Wimplausible-patterns +//> using options -Xfatal-warnings -Wimplausible-patterns sealed trait Exp[T] case class IntExp(x: Int) extends Exp[Int] diff --git a/tests/neg/i9751.scala b/tests/neg/i9751.scala index 3d168bcc3642..618d237e0cd4 100644 --- a/tests/neg/i9751.scala +++ b/tests/neg/i9751.scala @@ -1,4 +1,4 @@ -// scalac: -Xfatal-warnings +//> using options -Xfatal-warnings def f(): Unit = { () // error diff --git a/tests/neg/i9776.scala b/tests/neg/i9776.scala index 50062b932c3b..b05488810416 100644 --- a/tests/neg/i9776.scala +++ b/tests/neg/i9776.scala @@ -1,4 +1,4 @@ -// scalac: -Xfatal-warnings +//> using options -Xfatal-warnings import scala.annotation.switch diff --git a/tests/neg/i9880.scala b/tests/neg/i9880.scala index 86255a4009ba..f99fae25e5dc 100644 --- a/tests/neg/i9880.scala +++ b/tests/neg/i9880.scala @@ -1,4 +1,4 @@ -// scalac: -Xfatal-warnings +//> using options -Xfatal-warnings opaque type Bytes = Array[Byte] object Bytes: diff --git a/tests/neg/impl-conv/B.scala b/tests/neg/impl-conv/B.scala index 56befb18b2d7..618868b8bbc0 100644 --- a/tests/neg/impl-conv/B.scala +++ b/tests/neg/impl-conv/B.scala @@ -1,4 +1,4 @@ -// scalac: -Xfatal-warnings -feature +//> using options -Xfatal-warnings -feature package implConv diff --git a/tests/neg/implicit-conversions-old.scala b/tests/neg/implicit-conversions-old.scala index c2673e8b96eb..0a7b75766bbf 100644 --- a/tests/neg/implicit-conversions-old.scala +++ b/tests/neg/implicit-conversions-old.scala @@ -1,4 +1,4 @@ -// scalac: -Xfatal-warnings -feature +//> using options -Xfatal-warnings -feature class A class B diff --git a/tests/neg/implicit-conversions.scala b/tests/neg/implicit-conversions.scala index 0cec0de2f6ee..ead8c5ac7646 100644 --- a/tests/neg/implicit-conversions.scala +++ b/tests/neg/implicit-conversions.scala @@ -1,4 +1,4 @@ -// scalac: -Xfatal-warnings -feature +//> using options -Xfatal-warnings -feature class A class B diff --git a/tests/neg/indentLeft.scala b/tests/neg/indentLeft.scala index 177a4c0c33ae..c4a260583de2 100644 --- a/tests/neg/indentLeft.scala +++ b/tests/neg/indentLeft.scala @@ -1,4 +1,4 @@ -// scalac: -Xfatal-warnings +//> using options -Xfatal-warnings object Test { diff --git a/tests/neg/indentRight.scala b/tests/neg/indentRight.scala index 644814689da9..8eb9deb23389 100644 --- a/tests/neg/indentRight.scala +++ b/tests/neg/indentRight.scala @@ -1,4 +1,4 @@ -// scalac: -no-indent -Xfatal-warnings +//> using options -no-indent -Xfatal-warnings trait A case class B() extends A // error: Line is indented too far to the right diff --git a/tests/neg/infix.scala b/tests/neg/infix.scala index 7e68b8fb823d..aefdd5c40d47 100644 --- a/tests/neg/infix.scala +++ b/tests/neg/infix.scala @@ -1,4 +1,4 @@ -// scalac: -source future -deprecation -Xfatal-warnings +//> using options -source future -deprecation -Xfatal-warnings // Compile with -strict -Xfatal-warnings -deprecation class C: diff --git a/tests/neg/inline-givens.scala b/tests/neg/inline-givens.scala index d3edc13902dd..3e388de2ce8b 100644 --- a/tests/neg/inline-givens.scala +++ b/tests/neg/inline-givens.scala @@ -1,4 +1,4 @@ -// scalac: -Xfatal-warnings +//> using options -Xfatal-warnings class Item(x: String) diff --git a/tests/neg/jdk-9-app.scala b/tests/neg/jdk-9-app.scala index 21e09ec13643..4f78eb278876 100644 --- a/tests/neg/jdk-9-app.scala +++ b/tests/neg/jdk-9-app.scala @@ -1,4 +1,4 @@ -// scalac: -release:8 +//> using options -release:8 import java.lang.ProcessHandle // error: not a member diff --git a/tests/neg/kind-projector-underscores.scala b/tests/neg/kind-projector-underscores.scala index 1e80400105a8..76aada871fae 100644 --- a/tests/neg/kind-projector-underscores.scala +++ b/tests/neg/kind-projector-underscores.scala @@ -1,4 +1,4 @@ -// scalac: -Ykind-projector:underscores +//> using options -Ykind-projector:underscores package kind_projector_neg diff --git a/tests/neg/kind-projector.scala b/tests/neg/kind-projector.scala index dd0fb5d7149d..a7fc24c70b93 100644 --- a/tests/neg/kind-projector.scala +++ b/tests/neg/kind-projector.scala @@ -1,4 +1,4 @@ -// scalac: -Ykind-projector +//> using options -Ykind-projector package kind_projector_neg diff --git a/tests/neg/labelNotFound.scala b/tests/neg/labelNotFound.scala index 313e37e961b4..74ad6ef148ba 100644 --- a/tests/neg/labelNotFound.scala +++ b/tests/neg/labelNotFound.scala @@ -1,4 +1,4 @@ -// scalac: -explain +//> using options -explain object Test: scala.util.boundary.break(1) // error diff --git a/tests/neg/lambda-infer.scala b/tests/neg/lambda-infer.scala index e07c44523f60..90f40aa05e86 100644 --- a/tests/neg/lambda-infer.scala +++ b/tests/neg/lambda-infer.scala @@ -1,4 +1,4 @@ -// scalac: -language:experimental.erasedDefinitions +//> using options -language:experimental.erasedDefinitions type F = (Int, erased Int) => Int diff --git a/tests/neg/main-functions-nameclash.scala b/tests/neg/main-functions-nameclash.scala index 148667da133f..1f9352e1592d 100644 --- a/tests/neg/main-functions-nameclash.scala +++ b/tests/neg/main-functions-nameclash.scala @@ -1,4 +1,4 @@ -// scalac: -Xfatal-warnings +//> using options -Xfatal-warnings object foo { @main def foo(x: Int) = () // error: class foo and object foo produce classes that overwrite one another diff --git a/tests/neg/manifest-summoning-b.scala b/tests/neg/manifest-summoning-b.scala index 4dfee1f62f9a..6d1b8baff007 100644 --- a/tests/neg/manifest-summoning-b.scala +++ b/tests/neg/manifest-summoning-b.scala @@ -1,4 +1,4 @@ -// scalac: -Xfatal-warnings -deprecation +//> using options -Xfatal-warnings -deprecation val foo = manifest[List[? <: Int]] // error val bar = optManifest[Array[? <: String]] // error diff --git a/tests/neg/matchable.scala b/tests/neg/matchable.scala index 5ffd09b714b2..aaf8234f6d1e 100644 --- a/tests/neg/matchable.scala +++ b/tests/neg/matchable.scala @@ -1,4 +1,4 @@ -// scalac: -Xfatal-warnings -source future +//> using options -Xfatal-warnings -source future def foo[T](x: T): Matchable = println(x.getClass()) // ok diff --git a/tests/neg/missing-targetName.scala b/tests/neg/missing-targetName.scala index 9e83d2ad72ae..b5403ac7cb19 100644 --- a/tests/neg/missing-targetName.scala +++ b/tests/neg/missing-targetName.scala @@ -1,4 +1,4 @@ -// scalac: -Yrequire-targetName -Xfatal-warnings +//> using options -Yrequire-targetName -Xfatal-warnings // Compile with -strict -Xfatal-warnings -deprecation import scala.annotation.targetName diff --git a/tests/neg/multiple-args-consume.scala b/tests/neg/multiple-args-consume.scala index c8ea23f92318..6966eb0a3280 100644 --- a/tests/neg/multiple-args-consume.scala +++ b/tests/neg/multiple-args-consume.scala @@ -1,4 +1,4 @@ -// scalac: -language:experimental.erasedDefinitions +//> using options -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 41e65ab8390b..0349e956a6a8 100644 --- a/tests/neg/multiple-args.scala +++ b/tests/neg/multiple-args.scala @@ -1,4 +1,4 @@ -// scalac: -language:experimental.erasedDefinitions +//> using options -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/newline-braces.scala b/tests/neg/newline-braces.scala index 96e634a32773..afe7731f3095 100644 --- a/tests/neg/newline-braces.scala +++ b/tests/neg/newline-braces.scala @@ -1,4 +1,4 @@ -// scalac: -source 3.0-migration -Xfatal-warnings +//> using options -source 3.0-migration -Xfatal-warnings def f: List[Int] = { List(1, 2, 3).map // no newline inserted here in Scala-2 compat mode diff --git a/tests/neg/no-kind-polymorphism-anykind.scala b/tests/neg/no-kind-polymorphism-anykind.scala index daefc1774093..b14491468d00 100644 --- a/tests/neg/no-kind-polymorphism-anykind.scala +++ b/tests/neg/no-kind-polymorphism-anykind.scala @@ -1,3 +1,3 @@ -// scalac: -Yno-kind-polymorphism +//> using options -Yno-kind-polymorphism trait Foo[T <: AnyKind] // error: Not found: type AnyKind diff --git a/tests/neg/noimports-additional.scala b/tests/neg/noimports-additional.scala index e726db5b9b0a..e176135bd644 100644 --- a/tests/neg/noimports-additional.scala +++ b/tests/neg/noimports-additional.scala @@ -1,4 +1,4 @@ -// scalac: -Yno-imports -Yimports:scala.annotation,scala.util.matching +//> using options -Yno-imports -Yimports:scala.annotation,scala.util.matching class annotation extends Annotation val s: String = "str" // error val regex: Regex = new Regex("str") diff --git a/tests/neg/noimports.scala b/tests/neg/noimports.scala index 720d111757cd..468778eb0633 100644 --- a/tests/neg/noimports.scala +++ b/tests/neg/noimports.scala @@ -1,4 +1,4 @@ -// scalac: -Yno-imports +//> using options -Yno-imports object Test { val t: Int = 1 // error: not found Int } diff --git a/tests/neg/noimports2.scala b/tests/neg/noimports2.scala index deee773c35c6..33dc1537dd2d 100644 --- a/tests/neg/noimports2.scala +++ b/tests/neg/noimports2.scala @@ -1,4 +1,4 @@ -// scalac: -Yno-imports +//> using options -Yno-imports object Test { assert("asdf" == "asdf") // error: not found assert } diff --git a/tests/neg/nonunit-statement.scala b/tests/neg/nonunit-statement.scala index d48fb99841fb..73c190619187 100644 --- a/tests/neg/nonunit-statement.scala +++ b/tests/neg/nonunit-statement.scala @@ -1,4 +1,4 @@ -// scalac: -Xfatal-warnings -Wnonunit-statement -Wvalue-discard +//> using options -Xfatal-warnings -Wnonunit-statement -Wvalue-discard import collection.ArrayOps import collection.mutable.{ArrayBuilder, LinkedHashSet, ListBuffer} import concurrent._ diff --git a/tests/neg/nopredef-additional.scala b/tests/neg/nopredef-additional.scala index 0b6a71ca7c53..a91fcf340e3b 100644 --- a/tests/neg/nopredef-additional.scala +++ b/tests/neg/nopredef-additional.scala @@ -1,4 +1,4 @@ -// scalac: -Yno-predef -Yimports:java.lang,scala.annotation,scala.util.matching +//> using options -Yno-predef -Yimports:java.lang,scala.annotation,scala.util.matching class annotation extends Annotation val s: String = "str" val regex: Regex = s.r // error diff --git a/tests/neg/nopredef.scala b/tests/neg/nopredef.scala index fa9a344772a6..5b577180a4b9 100644 --- a/tests/neg/nopredef.scala +++ b/tests/neg/nopredef.scala @@ -1,4 +1,4 @@ -// scalac: -Yno-predef +//> using options -Yno-predef object Test { assert("asdf" == "asdf") // error: not found assert } diff --git a/tests/neg/nowarn-parser-error.scala b/tests/neg/nowarn-parser-error.scala index 7ff6c18ee306..1050a036f431 100644 --- a/tests/neg/nowarn-parser-error.scala +++ b/tests/neg/nowarn-parser-error.scala @@ -1,4 +1,4 @@ -// scalac: -deprecation -Wunused:nowarn +//> using options -deprecation -Wunused:nowarn class C { def a = try 1 // warn diff --git a/tests/neg/nowarn-typer-error.scala b/tests/neg/nowarn-typer-error.scala index 6c56110bc377..801d4e55977a 100644 --- a/tests/neg/nowarn-typer-error.scala +++ b/tests/neg/nowarn-typer-error.scala @@ -1,4 +1,4 @@ -// scalac: -deprecation -Wunused:nowarn +//> using options -deprecation -Wunused:nowarn import annotation.nowarn object T { diff --git a/tests/neg/nowarn.scala b/tests/neg/nowarn.scala index b40edfa6571c..5b18ab5ccc51 100644 --- a/tests/neg/nowarn.scala +++ b/tests/neg/nowarn.scala @@ -1,4 +1,4 @@ -// scalac: -deprecation -Wunused:nowarn "-Wconf:msg=@nowarn annotation does not suppress any warnings:e" +//> using options -deprecation -Wunused:nowarn "-Wconf:msg=@nowarn annotation does not suppress any warnings:e" import scala.annotation.{ nowarn, Annotation } diff --git a/tests/neg/old-syntax.scala b/tests/neg/old-syntax.scala index e974e1a258e2..124781d13db2 100644 --- a/tests/neg/old-syntax.scala +++ b/tests/neg/old-syntax.scala @@ -1,4 +1,4 @@ -// scalac: -Xfatal-warnings -deprecation +//> using options -Xfatal-warnings -deprecation val f = (x: Int) ⇒ x + 1 // error diff --git a/tests/neg/opaque-match.scala b/tests/neg/opaque-match.scala index 54f28a90f26e..59d0836fb2a3 100644 --- a/tests/neg/opaque-match.scala +++ b/tests/neg/opaque-match.scala @@ -1,4 +1,4 @@ -// scalac: -Xfatal-warnings +//> using options -Xfatal-warnings case class C() diff --git a/tests/neg/overrideClass.scala b/tests/neg/overrideClass.scala index eb5dcbe7ab39..182cf945ec00 100644 --- a/tests/neg/overrideClass.scala +++ b/tests/neg/overrideClass.scala @@ -1,4 +1,4 @@ -// scalac: -source 3.0-migration +//> using options -source 3.0-migration abstract class FooA { type A <: Ax; diff --git a/tests/neg/ovlazy.scala b/tests/neg/ovlazy.scala index 86d27ca37b03..69078fbd2745 100644 --- a/tests/neg/ovlazy.scala +++ b/tests/neg/ovlazy.scala @@ -1,4 +1,4 @@ -// scalac: -source 3.0-migration -Xfatal-warnings +//> using options -source 3.0-migration -Xfatal-warnings class A { val x: Int = 1 diff --git a/tests/neg/pureStatement.scala b/tests/neg/pureStatement.scala index c4c1c0799fa3..4d2ea1d49b08 100644 --- a/tests/neg/pureStatement.scala +++ b/tests/neg/pureStatement.scala @@ -1,4 +1,4 @@ -// scalac: -Xfatal-warnings +//> using options -Xfatal-warnings class IOCapability diff --git a/tests/neg/quote-simple-hole.scala b/tests/neg/quote-simple-hole.scala index 2724a3c6d95c..64e2bcad4862 100644 --- a/tests/neg/quote-simple-hole.scala +++ b/tests/neg/quote-simple-hole.scala @@ -1,4 +1,4 @@ -// scalac: -Xfatal-warnings +//> using options -Xfatal-warnings import scala.quoted.Quotes diff --git a/tests/neg/refinements-this.scala b/tests/neg/refinements-this.scala index 87814419b942..f8d41bd85360 100644 --- a/tests/neg/refinements-this.scala +++ b/tests/neg/refinements-this.scala @@ -1,4 +1,4 @@ -// scalac: -Xfatal-warnings +//> using options -Xfatal-warnings class Outer: type X = { type O = Outer.this.type } // ok diff --git a/tests/neg/refutable-pattern-binding-messages.scala b/tests/neg/refutable-pattern-binding-messages.scala index 97ce61503a2b..c6ae043652c2 100644 --- a/tests/neg/refutable-pattern-binding-messages.scala +++ b/tests/neg/refutable-pattern-binding-messages.scala @@ -1,4 +1,4 @@ -// scalac: -Werror +//> using options -Werror object Test { // refutable extractor object Positive { def unapply(i: Int): Option[Int] = Some(i).filter(_ > 0) } diff --git a/tests/neg/rewrite-messages.scala b/tests/neg/rewrite-messages.scala index b4f2bf75bfe3..7509682c4baa 100644 --- a/tests/neg/rewrite-messages.scala +++ b/tests/neg/rewrite-messages.scala @@ -1,4 +1,4 @@ -// scalac: -source:future-migration -deprecation -Werror +//> using options -source:future-migration -deprecation -Werror import scala.util._ // error diff --git a/tests/neg/sip-53-exprimental-a.scala b/tests/neg/sip-53-exprimental-a.scala index f9ce25aba095..1b2f5a24d8a9 100644 --- a/tests/neg/sip-53-exprimental-a.scala +++ b/tests/neg/sip-53-exprimental-a.scala @@ -1,4 +1,4 @@ -// scalac: -Yno-experimental +//> using options -Yno-experimental import scala.quoted.* diff --git a/tests/neg/sip-53-exprimental-b.scala b/tests/neg/sip-53-exprimental-b.scala index 05ef481b073b..0fb391c9cb5f 100644 --- a/tests/neg/sip-53-exprimental-b.scala +++ b/tests/neg/sip-53-exprimental-b.scala @@ -1,4 +1,4 @@ -// scalac: -Yno-experimental +//> using options -Yno-experimental import scala.quoted.* diff --git a/tests/neg/strict-pattern-bindings-3.2.scala b/tests/neg/strict-pattern-bindings-3.2.scala index d6c7a3ad70bb..d7db6cd165e4 100644 --- a/tests/neg/strict-pattern-bindings-3.2.scala +++ b/tests/neg/strict-pattern-bindings-3.2.scala @@ -1,4 +1,4 @@ -// scalac: -Xfatal-warnings +//> using options -Xfatal-warnings // These tests should fail under -Xfatal-warnings with source version source version 3.2 or later import language.`3.2` diff --git a/tests/neg/structural-2.scala b/tests/neg/structural-2.scala index e7d0c67ff6b4..3613d6073e34 100644 --- a/tests/neg/structural-2.scala +++ b/tests/neg/structural-2.scala @@ -1,4 +1,4 @@ -// scalac: -Xfatal-warnings +//> using options -Xfatal-warnings import scala.reflect.Selectable.reflectiveSelectable diff --git a/tests/neg/supertraits-b.scala b/tests/neg/supertraits-b.scala index 7e8560ee45c0..78854537974e 100644 --- a/tests/neg/supertraits-b.scala +++ b/tests/neg/supertraits-b.scala @@ -1,4 +1,4 @@ -// scalac: -Xfatal-warnings +//> using options -Xfatal-warnings transparent sealed trait TA transparent sealed trait TB diff --git a/tests/neg/suppressed-type-test-warnings.scala b/tests/neg/suppressed-type-test-warnings.scala index 332bcc3e0889..2414f13e73cb 100644 --- a/tests/neg/suppressed-type-test-warnings.scala +++ b/tests/neg/suppressed-type-test-warnings.scala @@ -1,4 +1,4 @@ -// scalac: -Xfatal-warnings +//> using options -Xfatal-warnings object Test { sealed trait Foo[A, B] diff --git a/tests/neg/switches.scala b/tests/neg/switches.scala index 3641b49d3e0c..d405f8185706 100644 --- a/tests/neg/switches.scala +++ b/tests/neg/switches.scala @@ -1,4 +1,4 @@ -// scalac: -Xfatal-warnings +//> using options -Xfatal-warnings import scala.annotation.switch diff --git a/tests/neg/symbolic-packages.scala b/tests/neg/symbolic-packages.scala index b9d365d44986..12719d027b4c 100644 --- a/tests/neg/symbolic-packages.scala +++ b/tests/neg/symbolic-packages.scala @@ -1,4 +1,4 @@ -// scalac: -Xfatal-warnings +//> using options -Xfatal-warnings package `with spaces` { // error class Foo diff --git a/tests/neg/t3235-minimal.scala b/tests/neg/t3235-minimal.scala index 22b29ef1fb31..f65ee13f87f5 100644 --- a/tests/neg/t3235-minimal.scala +++ b/tests/neg/t3235-minimal.scala @@ -1,4 +1,4 @@ -// scalac: -Xfatal-warnings -deprecation +//> using options -Xfatal-warnings -deprecation object Test { def main(args: Array[String]): Unit = { diff --git a/tests/neg/t5830.scala b/tests/neg/t5830.scala index 2e02d802b8e0..947b7bac4a22 100644 --- a/tests/neg/t5830.scala +++ b/tests/neg/t5830.scala @@ -1,4 +1,4 @@ -// scalac: -Xfatal-warnings +//> using options -Xfatal-warnings import scala.annotation.switch diff --git a/tests/neg/tupled-function-instances-2.scala b/tests/neg/tupled-function-instances-2.scala index b1ae120b8789..1abd3f3a3f54 100644 --- a/tests/neg/tupled-function-instances-2.scala +++ b/tests/neg/tupled-function-instances-2.scala @@ -1,4 +1,4 @@ -// scalac: -language:experimental.erasedDefinitions +//> using options -language:experimental.erasedDefinitions import scala.util.TupledFunction object Test { diff --git a/tests/neg/type-test-paths-2.scala b/tests/neg/type-test-paths-2.scala index e27db5a6636f..4bba2f87416e 100644 --- a/tests/neg/type-test-paths-2.scala +++ b/tests/neg/type-test-paths-2.scala @@ -1,4 +1,4 @@ -// scalac: -Xfatal-warnings +//> using options -Xfatal-warnings import scala.reflect.TypeTest diff --git a/tests/neg/type-test-paths.scala b/tests/neg/type-test-paths.scala index 45106bcb03e5..324ed43ba7fa 100644 --- a/tests/neg/type-test-paths.scala +++ b/tests/neg/type-test-paths.scala @@ -1,4 +1,4 @@ -// scalac: -Xfatal-warnings +//> using options -Xfatal-warnings import scala.reflect.TypeTest diff --git a/tests/neg/type-test-syntesize-b.scala b/tests/neg/type-test-syntesize-b.scala index 2fa8d2b9a3f3..79be9357387e 100644 --- a/tests/neg/type-test-syntesize-b.scala +++ b/tests/neg/type-test-syntesize-b.scala @@ -1,4 +1,4 @@ -// scalac: -Xfatal-warnings +//> using options -Xfatal-warnings import scala.reflect.TypeTest diff --git a/tests/neg/typeclass-derivation2.scala b/tests/neg/typeclass-derivation2.scala index d4c4b256a4e5..eca11fb326ed 100644 --- a/tests/neg/typeclass-derivation2.scala +++ b/tests/neg/typeclass-derivation2.scala @@ -1,4 +1,4 @@ -// scalac: -language:experimental.erasedDefinitions +//> using options -language:experimental.erasedDefinitions import scala.collection.mutable import scala.annotation.tailrec diff --git a/tests/neg/unchecked-patterns.scala b/tests/neg/unchecked-patterns.scala index 8974a2ad9dca..db304a2f1875 100644 --- a/tests/neg/unchecked-patterns.scala +++ b/tests/neg/unchecked-patterns.scala @@ -1,4 +1,4 @@ -// scalac: -Xfatal-warnings +//> using options -Xfatal-warnings object Test { diff --git a/tests/neg/warn-value-discard.scala b/tests/neg/warn-value-discard.scala index 149433395cc5..fb01fdeda384 100644 --- a/tests/neg/warn-value-discard.scala +++ b/tests/neg/warn-value-discard.scala @@ -1,4 +1,4 @@ -// scalac: -Wvalue-discard -Werror +//> using options -Wvalue-discard -Werror import scala.util.{Either, Right, Left} import scala.collection.mutable diff --git a/tests/neg/xfatalWarnings.scala b/tests/neg/xfatalWarnings.scala index aa1be34b2f84..3f49e159cbc4 100644 --- a/tests/neg/xfatalWarnings.scala +++ b/tests/neg/xfatalWarnings.scala @@ -1,4 +1,4 @@ -// scalac: -Xfatal-warnings +//> using options -Xfatal-warnings object xfatalWarnings { val opt:Option[String] = Some("test") diff --git a/tests/neg/yimports-custom/C_2.scala b/tests/neg/yimports-custom/C_2.scala index 6ba25ad2963c..03bb24433962 100644 --- a/tests/neg/yimports-custom/C_2.scala +++ b/tests/neg/yimports-custom/C_2.scala @@ -1,4 +1,4 @@ -// scalac: -Yimports:hello.world.minidef +//> using options -Yimports:hello.world.minidef class C { val v: Numb = Magic diff --git a/tests/neg/yimports-nojava.scala b/tests/neg/yimports-nojava.scala index 35233e37a775..7e5349635207 100644 --- a/tests/neg/yimports-nojava.scala +++ b/tests/neg/yimports-nojava.scala @@ -1,4 +1,4 @@ -// scalac: -Yimports:scala,scala.Predef +//> using options -Yimports:scala,scala.Predef trait T { def f() = println("hello, world!") diff --git a/tests/neg/yimports-nosuch.scala b/tests/neg/yimports-nosuch.scala index 431daf39a180..b02c1c6f662e 100644 --- a/tests/neg/yimports-nosuch.scala +++ b/tests/neg/yimports-nosuch.scala @@ -1,4 +1,4 @@ -// scalac: -Yimports:skala,scala.Predeff +//> using options -Yimports:skala,scala.Predeff // class C // nopos-error diff --git a/tests/neg/yimports-predef.scala b/tests/neg/yimports-predef.scala index 8bfe89b08cd8..ecbe017a9c75 100644 --- a/tests/neg/yimports-predef.scala +++ b/tests/neg/yimports-predef.scala @@ -1,4 +1,4 @@ -// scalac: -Yimports:scala,scala.Predef +//> using options -Yimports:scala,scala.Predef // import Predef.{any2stringadd => _, _} diff --git a/tests/neg/yimports-stable/C_2.scala b/tests/neg/yimports-stable/C_2.scala index 0b97775f1a01..6cd8c17f6620 100644 --- a/tests/neg/yimports-stable/C_2.scala +++ b/tests/neg/yimports-stable/C_2.scala @@ -1,4 +1,4 @@ -// scalac: -Yimports:scala,scala.Predef,hello.world.potions +//> using options -Yimports:scala,scala.Predef,hello.world.potions // class C { val v: Numb = magic // error // error diff --git a/tests/patmat/i10174b.scala b/tests/patmat/i10174b.scala index 875e19e8f037..96e0a1a216c4 100644 --- a/tests/patmat/i10174b.scala +++ b/tests/patmat/i10174b.scala @@ -1,4 +1,4 @@ -// scalac: -Ycheck-all-patmat +//> using options -Ycheck-all-patmat def foo(x: Int): Unit = x match { case 1 => diff --git a/tests/patmat/i14407.dupe.scala b/tests/patmat/i14407.dupe.scala index acc019e41e8a..1d742315fdd4 100644 --- a/tests/patmat/i14407.dupe.scala +++ b/tests/patmat/i14407.dupe.scala @@ -1,4 +1,4 @@ -// scalac: -Werror +//> using options -Werror @main def Test = val it: Int = 42 42L match diff --git a/tests/patmat/i14407.scala b/tests/patmat/i14407.scala index a1f710bd6acb..ec95c5c014de 100644 --- a/tests/patmat/i14407.scala +++ b/tests/patmat/i14407.scala @@ -1,4 +1,4 @@ -// scalac: -Werror +//> using options -Werror @main def Test = val it: Int = 42 42L match diff --git a/tests/patmat/i18118.scala b/tests/patmat/i18118.scala index c51d736d3db3..fc889d4d49b3 100644 --- a/tests/patmat/i18118.scala +++ b/tests/patmat/i18118.scala @@ -1,4 +1,4 @@ -// scalac: -Werror +//> using options -Werror object O1: sealed trait A diff --git a/tests/patmat/i6197d.scala b/tests/patmat/i6197d.scala index 419c6e7ec2fa..4754e948c684 100644 --- a/tests/patmat/i6197d.scala +++ b/tests/patmat/i6197d.scala @@ -1,4 +1,4 @@ -// scalac: -Ycheck-all-patmat +//> using options -Ycheck-all-patmat def foo(x: Array[String]) = x match { case _: Array[_] => } diff --git a/tests/patmat/i6255b.scala b/tests/patmat/i6255b.scala index 02fba4ad9100..3982c90a91f5 100644 --- a/tests/patmat/i6255b.scala +++ b/tests/patmat/i6255b.scala @@ -1,4 +1,4 @@ -// scalac: -Ycheck-all-patmat +//> using options -Ycheck-all-patmat class Foo { def foo(x: quoted.Expr[Int])(using scala.quoted.Quotes): Unit = x match { case '{ 1 } => diff --git a/tests/patmat/patmat-indent.scala b/tests/patmat/patmat-indent.scala index f62d704f8ca0..4bf36d2e4bb7 100644 --- a/tests/patmat/patmat-indent.scala +++ b/tests/patmat/patmat-indent.scala @@ -1,4 +1,4 @@ -// scalac: -Ycheck-all-patmat +//> using options -Ycheck-all-patmat object Test { val Nil: scala.collection.immutable.Nil.type = scala.collection.immutable.Nil val X = 5 diff --git a/tests/patmat/t10502.scala b/tests/patmat/t10502.scala index 71066fdb7ae8..8efa5ab5fb26 100644 --- a/tests/patmat/t10502.scala +++ b/tests/patmat/t10502.scala @@ -1,4 +1,4 @@ -// scalac: -Ycheck-all-patmat +//> using options -Ycheck-all-patmat object Perhaps { def unapply[A](oa: Option[A]): Some[Option[A]] = Some(oa) diff --git a/tests/patmat/t3163.scala b/tests/patmat/t3163.scala index 19aa6fe93ca8..6b7fe8e3ca4a 100644 --- a/tests/patmat/t3163.scala +++ b/tests/patmat/t3163.scala @@ -1,4 +1,4 @@ -// scalac: -Ycheck-all-patmat +//> using options -Ycheck-all-patmat object Test { def foo(x : AnyVal) = x match {case b : Boolean => "It's a bool"} } diff --git a/tests/patmat/t4526.scala b/tests/patmat/t4526.scala index 016f3782b65b..d29ae4ce97d7 100644 --- a/tests/patmat/t4526.scala +++ b/tests/patmat/t4526.scala @@ -1,4 +1,4 @@ -// scalac: -Ycheck-all-patmat +//> using options -Ycheck-all-patmat object Test{ def foo(a: Int) = a match { case 5 => "Five!" diff --git a/tests/patmat/t4661b.scala b/tests/patmat/t4661b.scala index f2329020cb66..c442fbe5b2a2 100644 --- a/tests/patmat/t4661b.scala +++ b/tests/patmat/t4661b.scala @@ -1,4 +1,4 @@ -// scalac: -Ycheck-all-patmat +//> using options -Ycheck-all-patmat class C { trait Foo class One extends Foo diff --git a/tests/patmat/t9351.scala b/tests/patmat/t9351.scala index b43fa948ce87..8d5a939d1c2c 100644 --- a/tests/patmat/t9351.scala +++ b/tests/patmat/t9351.scala @@ -1,4 +1,4 @@ -// scalac: -Ycheck-all-patmat +//> using options -Ycheck-all-patmat trait A {} case object B extends A {} case object C extends A {} diff --git a/tests/patmat/t9809.scala b/tests/patmat/t9809.scala index 72ff23b11e51..180bfe648dc0 100644 --- a/tests/patmat/t9809.scala +++ b/tests/patmat/t9809.scala @@ -1,4 +1,4 @@ -// scalac: -Ycheck-all-patmat +//> using options -Ycheck-all-patmat object Example { val op1: (Any, Any) => Unit = { case (_, b: Int) => diff --git a/tests/pending/neg/i16451.scala b/tests/pending/neg/i16451.scala index 49997d2bcf92..3a93a97e1f03 100644 --- a/tests/pending/neg/i16451.scala +++ b/tests/pending/neg/i16451.scala @@ -1,4 +1,4 @@ -// scalac: -Werror +//> using options -Werror enum Color: case Red, Green diff --git a/tests/pending/neg/yimports-custom-b/C_2.scala b/tests/pending/neg/yimports-custom-b/C_2.scala index 8da798e80b0d..8a7771d192c9 100644 --- a/tests/pending/neg/yimports-custom-b/C_2.scala +++ b/tests/pending/neg/yimports-custom-b/C_2.scala @@ -1,4 +1,4 @@ -// scalac: -Yimports:hello.world.minidef +//> using options -Yimports:hello.world.minidef import hello.{world => hw} import hw.minidef.{Magic => Answer} diff --git a/tests/pending/neg/yimports-custom-b/minidef_1.scala b/tests/pending/neg/yimports-custom-b/minidef_1.scala index befc137b6ab6..78d2f3c03bfc 100644 --- a/tests/pending/neg/yimports-custom-b/minidef_1.scala +++ b/tests/pending/neg/yimports-custom-b/minidef_1.scala @@ -1,4 +1,4 @@ -// scalac: -Yimports:scala +//> using options -Yimports:scala package hello.world diff --git a/tests/pending/neg/yimports-masked/C_2.scala b/tests/pending/neg/yimports-masked/C_2.scala index 1b6c736bad7b..acd9d953a125 100644 --- a/tests/pending/neg/yimports-masked/C_2.scala +++ b/tests/pending/neg/yimports-masked/C_2.scala @@ -1,4 +1,4 @@ -// scalac: -Yimports:scala,hello.world.minidef +//> using options -Yimports:scala,hello.world.minidef // import at top level or top of package disables implicit import. // the import can appear at any statement position, here, end of package. diff --git a/tests/pos-macros/i13405/Test.scala b/tests/pos-macros/i13405/Test.scala index d8e048ac1331..b698bd875642 100644 --- a/tests/pos-macros/i13405/Test.scala +++ b/tests/pos-macros/i13405/Test.scala @@ -1,3 +1,3 @@ -// scalac: -Xfatal-warnings +//> using options -Xfatal-warnings @main def main: Unit = hh() diff --git a/tests/pos-macros/i7592/Test_2.scala b/tests/pos-macros/i7592/Test_2.scala index c7c4c09b2180..84b5e52d8da4 100644 --- a/tests/pos-macros/i7592/Test_2.scala +++ b/tests/pos-macros/i7592/Test_2.scala @@ -1,4 +1,4 @@ -// scalac: -Yretain-trees +//> using options -Yretain-trees def return1 = 1 diff --git a/tests/pos-macros/semanticdb-inline-unapply/App_2.scala b/tests/pos-macros/semanticdb-inline-unapply/App_2.scala index 114cfd2240b5..2d5383505219 100644 --- a/tests/pos-macros/semanticdb-inline-unapply/App_2.scala +++ b/tests/pos-macros/semanticdb-inline-unapply/App_2.scala @@ -1,4 +1,4 @@ -// scalac: -Xsemanticdb +//> using options -Xsemanticdb object Test { def main(args: Array[String]): Unit = { diff --git a/tests/pos-macros/semanticdb-inline-unapply/Macro_1.scala b/tests/pos-macros/semanticdb-inline-unapply/Macro_1.scala index 14d176430d69..eb6fe1109fbc 100644 --- a/tests/pos-macros/semanticdb-inline-unapply/Macro_1.scala +++ b/tests/pos-macros/semanticdb-inline-unapply/Macro_1.scala @@ -1,4 +1,4 @@ -// scalac: -Xsemanticdb +//> using options -Xsemanticdb import scala.quoted.* diff --git a/tests/pos-macros/semanticdb-macro-pos/example_1.scala b/tests/pos-macros/semanticdb-macro-pos/example_1.scala index 421553b134fe..87cd556db1f2 100644 --- a/tests/pos-macros/semanticdb-macro-pos/example_1.scala +++ b/tests/pos-macros/semanticdb-macro-pos/example_1.scala @@ -1,4 +1,4 @@ -// scalac: -Xsemanticdb +//> using options -Xsemanticdb import quoted.* diff --git a/tests/pos-macros/semanticdb-macro-pos/example_2.scala b/tests/pos-macros/semanticdb-macro-pos/example_2.scala index a652346c5e14..0a2ceb596a2d 100644 --- a/tests/pos-macros/semanticdb-macro-pos/example_2.scala +++ b/tests/pos-macros/semanticdb-macro-pos/example_2.scala @@ -1,4 +1,4 @@ -// scalac: -Xsemanticdb +//> using options -Xsemanticdb import quoted.* diff --git a/tests/pos-macros/semanticdb-macro-pos/example_3.scala b/tests/pos-macros/semanticdb-macro-pos/example_3.scala index bd4dbdee3621..0db4dbdc79e2 100644 --- a/tests/pos-macros/semanticdb-macro-pos/example_3.scala +++ b/tests/pos-macros/semanticdb-macro-pos/example_3.scala @@ -1,4 +1,4 @@ -// scalac: -Xsemanticdb +//> using options -Xsemanticdb object Test { diff --git a/tests/pos-special/fatal-warnings/i17314.scala b/tests/pos-special/fatal-warnings/i17314.scala index 23f988741bed..215b13f671d5 100644 --- a/tests/pos-special/fatal-warnings/i17314.scala +++ b/tests/pos-special/fatal-warnings/i17314.scala @@ -1,4 +1,4 @@ -// scalac: "-Wunused:all" +//> using options "-Wunused:all" import java.net.URI diff --git a/tests/pos-special/fatal-warnings/i17314a.scala b/tests/pos-special/fatal-warnings/i17314a.scala index 468b956fb04c..6a6712855850 100644 --- a/tests/pos-special/fatal-warnings/i17314a.scala +++ b/tests/pos-special/fatal-warnings/i17314a.scala @@ -1,4 +1,4 @@ -// scalac: -Wunused:all +//> using options -Wunused:all package foo: class Foo[T] diff --git a/tests/pos-special/fatal-warnings/i17631.scala b/tests/pos-special/fatal-warnings/i17631.scala index 3846e51c16cf..6afa45923681 100644 --- a/tests/pos-special/fatal-warnings/i17631.scala +++ b/tests/pos-special/fatal-warnings/i17631.scala @@ -1,4 +1,4 @@ -// scalac: -Wunused:all +//> using options -Wunused:all object foo { type Bar diff --git a/tests/pos/adhoc-extension/A.scala b/tests/pos/adhoc-extension/A.scala index c1c0330de254..efc0415cdc15 100644 --- a/tests/pos/adhoc-extension/A.scala +++ b/tests/pos/adhoc-extension/A.scala @@ -1,4 +1,4 @@ -// scalac: -source future -deprecation -Xfatal-warnings +//> using options -source future -deprecation -Xfatal-warnings package adhoc class A diff --git a/tests/pos/cc-experimental.scala b/tests/pos/cc-experimental.scala index bcab127e5c12..4ee1f6732356 100644 --- a/tests/pos/cc-experimental.scala +++ b/tests/pos/cc-experimental.scala @@ -1,4 +1,4 @@ -// scalac: -Yno-experimental +//> using options -Yno-experimental package scala.runtime diff --git a/tests/pos/dotty-experimental.scala b/tests/pos/dotty-experimental.scala index 00b5691265a1..ada386143a0a 100644 --- a/tests/pos/dotty-experimental.scala +++ b/tests/pos/dotty-experimental.scala @@ -1,4 +1,4 @@ -// scalac: -Yno-experimental +//> 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 98948f5ed483..cf68e17dfbbb 100644 --- a/tests/pos/erased-args-lifted.scala +++ b/tests/pos/erased-args-lifted.scala @@ -1,4 +1,4 @@ -// scalac: -language:experimental.erasedDefinitions +//> using options -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 c08b13232dfc..692ff3a16b05 100644 --- a/tests/pos/erased-asInstanceOf.scala +++ b/tests/pos/erased-asInstanceOf.scala @@ -1,4 +1,4 @@ -// scalac: -language:experimental.erasedDefinitions +//> using options -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 91d8900e6cc2..128cd2b818e4 100644 --- a/tests/pos/erased-class-as-args.scala +++ b/tests/pos/erased-class-as-args.scala @@ -1,4 +1,4 @@ -// scalac: -language:experimental.erasedDefinitions +//> using options -language:experimental.erasedDefinitions erased class A diff --git a/tests/pos/erased-deep-context.scala b/tests/pos/erased-deep-context.scala index 2412b86e5613..2303feec5747 100644 --- a/tests/pos/erased-deep-context.scala +++ b/tests/pos/erased-deep-context.scala @@ -1,4 +1,4 @@ -// scalac: -language:experimental.erasedDefinitions +//> using options -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 c0717be49e7e..f0d5f502334c 100644 --- a/tests/pos/erased-extension-method.scala +++ b/tests/pos/erased-extension-method.scala @@ -1,4 +1,4 @@ -// scalac: -language:experimental.erasedDefinitions +//> using options -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 dad8944ac2eb..383275341904 100644 --- a/tests/pos/erased-lub-2.scala +++ b/tests/pos/erased-lub-2.scala @@ -1,4 +1,4 @@ -// scalac: -language:experimental.erasedDefinitions +//> using options -language:experimental.erasedDefinitions trait Foo diff --git a/tests/pos/erased-lub.scala b/tests/pos/erased-lub.scala index 8aeabbccdae7..06ee25be79e1 100644 --- a/tests/pos/erased-lub.scala +++ b/tests/pos/erased-lub.scala @@ -1,4 +1,4 @@ -// scalac: -language:experimental.erasedDefinitions +//> using options -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 c5dc8b0c360c..fdcc6d85ebd0 100644 --- a/tests/pos/erased-soft-keyword.scala +++ b/tests/pos/erased-soft-keyword.scala @@ -1,4 +1,4 @@ -// scalac: -language:experimental.erasedDefinitions +//> using options -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 caa5a639923f..bd0e012e6e6c 100644 --- a/tests/pos/erased-typedef.scala +++ b/tests/pos/erased-typedef.scala @@ -1,4 +1,4 @@ -// scalac: -language:experimental.erasedDefinitions +//> using options -language:experimental.erasedDefinitions trait Monadless[Monad[_]] { diff --git a/tests/pos/experimental-imports-empty.scala b/tests/pos/experimental-imports-empty.scala index a1568c39ae28..18d83839e7e7 100644 --- a/tests/pos/experimental-imports-empty.scala +++ b/tests/pos/experimental-imports-empty.scala @@ -1,4 +1,4 @@ -// scalac: -Yno-experimental +//> using options -Yno-experimental import annotation.experimental import language.experimental.namedTypeArguments diff --git a/tests/pos/experimental-imports-top.scala b/tests/pos/experimental-imports-top.scala index 20ea119621f4..16f44e48eb32 100644 --- a/tests/pos/experimental-imports-top.scala +++ b/tests/pos/experimental-imports-top.scala @@ -1,4 +1,4 @@ -// scalac: -Yno-experimental +//> using options -Yno-experimental import language.experimental.erasedDefinitions import annotation.experimental diff --git a/tests/pos/extend-java-enum.scala b/tests/pos/extend-java-enum.scala index 351d0e4c74eb..f58922f81749 100644 --- a/tests/pos/extend-java-enum.scala +++ b/tests/pos/extend-java-enum.scala @@ -1,4 +1,4 @@ -// scalac: -source 3.0-migration +//> using options -source 3.0-migration import java.{lang as jl} diff --git a/tests/pos/help.scala b/tests/pos/help.scala index 7e49f7de0c30..0f674fd3ba3b 100644 --- a/tests/pos/help.scala +++ b/tests/pos/help.scala @@ -1,4 +1,4 @@ -// scalac: -help -V -W -X -Y +//> using options -help -V -W -X -Y // dummy source for exercising information flags // diff --git a/tests/pos/i10383.scala b/tests/pos/i10383.scala index 3a9b44d2774d..f14267a38041 100644 --- a/tests/pos/i10383.scala +++ b/tests/pos/i10383.scala @@ -1,3 +1,3 @@ -// scalac: -source future -deprecation -Xfatal-warnings +//> using options -source future -deprecation -Xfatal-warnings def r = BigInt(1) to BigInt(3) // error diff --git a/tests/pos/i10848a.scala b/tests/pos/i10848a.scala index 85fa3328486f..434cf716c930 100644 --- a/tests/pos/i10848a.scala +++ b/tests/pos/i10848a.scala @@ -1,4 +1,4 @@ -// scalac: -language:experimental.erasedDefinitions +//> using options -language:experimental.erasedDefinitions class IsOn[T] type On diff --git a/tests/pos/i10848b.scala b/tests/pos/i10848b.scala index 429e718b84b1..bff74663c359 100644 --- a/tests/pos/i10848b.scala +++ b/tests/pos/i10848b.scala @@ -1,4 +1,4 @@ -// scalac: -language:experimental.erasedDefinitions +//> using options -language:experimental.erasedDefinitions class Foo: erased given Int = 1 diff --git a/tests/pos/i11022.scala b/tests/pos/i11022.scala index d020669049c5..aa211426387d 100644 --- a/tests/pos/i11022.scala +++ b/tests/pos/i11022.scala @@ -1,3 +1,3 @@ -// scalac: -Werror -deprecation +//> using options -Werror -deprecation @deprecated("no CaseClass") case class CaseClass(rgb: Int) diff --git a/tests/pos/i13044.scala b/tests/pos/i13044.scala index d24b333c480c..4c9b8b914062 100644 --- a/tests/pos/i13044.scala +++ b/tests/pos/i13044.scala @@ -1,4 +1,4 @@ -// scalac: -Xmax-inlines:33 +//> using options -Xmax-inlines:33 import scala.deriving.Mirror import scala.compiletime._ diff --git a/tests/pos/i13548.scala b/tests/pos/i13548.scala index 2f2f62e17878..85df1bcd576e 100644 --- a/tests/pos/i13548.scala +++ b/tests/pos/i13548.scala @@ -1,4 +1,4 @@ -// scalac: -Werror +//> using options -Werror sealed abstract class Foo[N, A] final case class Bar[B](foo: Foo[B, B]) extends Foo[B, B] class Test: diff --git a/tests/pos/i13848.scala b/tests/pos/i13848.scala index 06f067889d2d..266f3edcf7ae 100644 --- a/tests/pos/i13848.scala +++ b/tests/pos/i13848.scala @@ -1,4 +1,4 @@ -// scalac: -Yno-experimental +//> using options -Yno-experimental import annotation.experimental diff --git a/tests/pos/i14287.scala b/tests/pos/i14287.scala index 1291dc8adefc..a6063c00a9cc 100644 --- a/tests/pos/i14287.scala +++ b/tests/pos/i14287.scala @@ -1,4 +1,4 @@ -// scalac: -Yno-deep-subtypes +//> using options -Yno-deep-subtypes enum Free[+F[_], A]: case Return(a: A) case Suspend(s: F[A]) diff --git a/tests/pos/i14587.hard-union-tuples.scala b/tests/pos/i14587.hard-union-tuples.scala index e1a086655e5f..0ce4f46a101f 100644 --- a/tests/pos/i14587.hard-union-tuples.scala +++ b/tests/pos/i14587.hard-union-tuples.scala @@ -1,4 +1,4 @@ -// scalac: -Werror +//> using options -Werror class Test: type Foo = Option[String] | Option[Int] diff --git a/tests/pos/i14807.scala b/tests/pos/i14807.scala index 7d3dbbcbed66..d914e9221f03 100644 --- a/tests/pos/i14807.scala +++ b/tests/pos/i14807.scala @@ -1,4 +1,4 @@ -// scalac: -Werror +//> using options -Werror enum Foo: case One(value: String) case Two(value: Long, month: java.time.Month) diff --git a/tests/pos/i15029.bootstrap-reg.scala b/tests/pos/i15029.bootstrap-reg.scala index 980781aada07..11081590a13c 100644 --- a/tests/pos/i15029.bootstrap-reg.scala +++ b/tests/pos/i15029.bootstrap-reg.scala @@ -1,4 +1,4 @@ -// scalac: -Werror +//> using options -Werror // minimisation of a regression that occurred in bootstrapping class Test: def t(a: Boolean, b: Boolean) = (a, b) match diff --git a/tests/pos/i15029.more.scala b/tests/pos/i15029.more.scala index 71b80211b717..fba375cfcb33 100644 --- a/tests/pos/i15029.more.scala +++ b/tests/pos/i15029.more.scala @@ -1,4 +1,4 @@ -// scalac: -Werror +//> using options -Werror // Like tests/pos/i15029.scala, // but with a more complicated prefix diff --git a/tests/pos/i15029.orig.scala b/tests/pos/i15029.orig.scala index f671f4fa9184..cd7f6465d530 100644 --- a/tests/pos/i15029.orig.scala +++ b/tests/pos/i15029.orig.scala @@ -1,4 +1,4 @@ -// scalac: -Werror +//> using options -Werror sealed trait Schema[A] object Schema extends RecordInstances diff --git a/tests/pos/i15029.scala b/tests/pos/i15029.scala index eeaa1613ad9b..7a85fe5b30d4 100644 --- a/tests/pos/i15029.scala +++ b/tests/pos/i15029.scala @@ -1,4 +1,4 @@ -// scalac: -Werror +//> using options -Werror sealed trait Schema[A] sealed trait RecordInstances: diff --git a/tests/pos/i15133a.scala b/tests/pos/i15133a.scala index 1dc8d489081e..1aff3a5c1cfc 100644 --- a/tests/pos/i15133a.scala +++ b/tests/pos/i15133a.scala @@ -1,4 +1,4 @@ -// scalac: -Yno-experimental +//> using options -Yno-experimental import scala.annotation.experimental diff --git a/tests/pos/i15133b.scala b/tests/pos/i15133b.scala index 111f55dea29f..4c235d37c698 100644 --- a/tests/pos/i15133b.scala +++ b/tests/pos/i15133b.scala @@ -1,4 +1,4 @@ -// scalac: -Yno-experimental +//> using options -Yno-experimental import scala.annotation.experimental diff --git a/tests/pos/i15166/Test_2.scala b/tests/pos/i15166/Test_2.scala index 53e6da69a42c..b447aacde2ab 100644 --- a/tests/pos/i15166/Test_2.scala +++ b/tests/pos/i15166/Test_2.scala @@ -1,4 +1,4 @@ -// scalac: -Xfatal-warnings +//> using options -Xfatal-warnings object Test { val x: InterfaceAudience_JAVA_ONLY_1.Public = ??? } diff --git a/tests/pos/i15226.scala b/tests/pos/i15226.scala index d40b21e4cedb..dfb61efc6a8c 100644 --- a/tests/pos/i15226.scala +++ b/tests/pos/i15226.scala @@ -1,4 +1,4 @@ -// scalac: -Werror +//> using options -Werror class Proj { type State = String } sealed trait ProjState: diff --git a/tests/pos/i15289.scala b/tests/pos/i15289.scala index 5eea2fe9f91f..2035d2bb68cb 100644 --- a/tests/pos/i15289.scala +++ b/tests/pos/i15289.scala @@ -1,4 +1,4 @@ -// scalac: -Werror +//> using options -Werror sealed abstract class Foo[A, B] final case class Bar[C](baz: C) extends Foo[C, C] diff --git a/tests/pos/i15522.scala b/tests/pos/i15522.scala index 9b6b99872080..895867dd0ceb 100644 --- a/tests/pos/i15522.scala +++ b/tests/pos/i15522.scala @@ -1,4 +1,4 @@ -// scalac: -Werror +//> using options -Werror sealed trait Coverage sealed abstract case class Range(min: Double, max: Double) extends Coverage case object Empty extends Coverage diff --git a/tests/pos/i15523.avoid.scala b/tests/pos/i15523.avoid.scala index afbfc1a69d60..1a4bae86505d 100644 --- a/tests/pos/i15523.avoid.scala +++ b/tests/pos/i15523.avoid.scala @@ -1,4 +1,4 @@ -// scalac: -Werror +//> using options -Werror // like the original, but with a case body `a` // which caused type avoidance to infinitely recurse sealed trait Parent diff --git a/tests/pos/i15523.scala b/tests/pos/i15523.scala index cf63613c29ac..ca2d843dbe4f 100644 --- a/tests/pos/i15523.scala +++ b/tests/pos/i15523.scala @@ -1,4 +1,4 @@ -// scalac: -Werror +//> using options -Werror sealed trait Parent final case class Leaf[A, B >: A](a: A, b: B) extends Parent diff --git a/tests/pos/i15579.scala b/tests/pos/i15579.scala index 64b67cf3c069..952fab51de96 100644 --- a/tests/pos/i15579.scala +++ b/tests/pos/i15579.scala @@ -1,4 +1,4 @@ -// scalac: -source:future +//> using options -source:future trait Foo[A]: def map[B](f: A => B): Foo[B] = ??? diff --git a/tests/pos/i15717.scala b/tests/pos/i15717.scala index d625d9ccb039..337a1f08ed10 100644 --- a/tests/pos/i15717.scala +++ b/tests/pos/i15717.scala @@ -1,4 +1,4 @@ -// scalac: -Werror +//> using options -Werror class Test: def pmat(xs: java.util.Vector[_]): String = xs.get(0) match case d: Double => d.toString() // was: error: unreachable case, which is spurious diff --git a/tests/pos/i15964.scala b/tests/pos/i15964.scala index 5713f19e4419..33797da76610 100644 --- a/tests/pos/i15964.scala +++ b/tests/pos/i15964.scala @@ -1,4 +1,4 @@ -// scalac: -Werror +//> using options -Werror sealed trait T class C extends T diff --git a/tests/pos/i15967.scala b/tests/pos/i15967.scala index 0ef00ae0cea1..1bf03a87cdd4 100644 --- a/tests/pos/i15967.scala +++ b/tests/pos/i15967.scala @@ -1,4 +1,4 @@ -// scalac: -Werror +//> using options -Werror sealed trait A[-Z] final case class B[Y]() extends A[Y] diff --git a/tests/pos/i16091.scala b/tests/pos/i16091.scala index ac752064e70e..349e16e6d7e6 100644 --- a/tests/pos/i16091.scala +++ b/tests/pos/i16091.scala @@ -1,4 +1,4 @@ -// scalac: -Yno-experimental +//> using options -Yno-experimental import scala.annotation.experimental diff --git a/tests/pos/i16123.scala b/tests/pos/i16123.scala index 2cba8f6dc96f..4b3cf483d8e7 100644 --- a/tests/pos/i16123.scala +++ b/tests/pos/i16123.scala @@ -1,4 +1,4 @@ -// scalac: -Werror +//> using options -Werror sealed trait Nat case class Zero() extends Nat case class Succ[N <: Nat](n: N) extends Nat diff --git a/tests/pos/i16339.scala b/tests/pos/i16339.scala index 72582b778193..49924548bb3f 100644 --- a/tests/pos/i16339.scala +++ b/tests/pos/i16339.scala @@ -1,4 +1,4 @@ -// scalac: -Werror +//> using options -Werror sealed trait Get[X, +X2 <: X] case class Bar[Y, Y2 <: Y](value: Y2) extends Get[Y, Y2] diff --git a/tests/pos/i16435.scala b/tests/pos/i16435.scala index 3fb36efc55c9..fb738e3041e4 100644 --- a/tests/pos/i16435.scala +++ b/tests/pos/i16435.scala @@ -1,4 +1,4 @@ -// scalac: -Werror +//> using options -Werror trait Base: type Value inline def oov: Option[Option[Value]] = None diff --git a/tests/pos/i16451.CanForward.scala b/tests/pos/i16451.CanForward.scala index a09a26f22acc..f45eace440e3 100644 --- a/tests/pos/i16451.CanForward.scala +++ b/tests/pos/i16451.CanForward.scala @@ -1,4 +1,4 @@ -// scalac: -Werror +//> using options -Werror abstract class Namer: private enum CanForward: case Yes diff --git a/tests/pos/i16451.DiffUtil.scala b/tests/pos/i16451.DiffUtil.scala index 3ade8bb73aa7..4a2f16aa05ed 100644 --- a/tests/pos/i16451.DiffUtil.scala +++ b/tests/pos/i16451.DiffUtil.scala @@ -1,4 +1,4 @@ -// scalac: -Werror +//> using options -Werror object DiffUtil: private sealed trait Patch private final case class Unmodified(str: String) extends Patch diff --git a/tests/pos/i16451.default.scala b/tests/pos/i16451.default.scala index 2751f4901b5f..bc6c7a403be8 100644 --- a/tests/pos/i16451.default.scala +++ b/tests/pos/i16451.default.scala @@ -1,4 +1,4 @@ -// scalac: -Werror +//> using options -Werror import java.lang.reflect.* import scala.annotation.tailrec diff --git a/tests/pos/i16539.min.scala b/tests/pos/i16539.min.scala index d02e34461ab6..22a96bc12910 100644 --- a/tests/pos/i16539.min.scala +++ b/tests/pos/i16539.min.scala @@ -1,4 +1,4 @@ -// scalac: -Werror +//> using options -Werror sealed trait Tag[A] sealed trait Foo diff --git a/tests/pos/i16539.scala b/tests/pos/i16539.scala index c5cf45b214ef..e03991e10889 100644 --- a/tests/pos/i16539.scala +++ b/tests/pos/i16539.scala @@ -1,4 +1,4 @@ -// scalac: -Werror +//> using options -Werror sealed trait Tag[A] enum Hidden: diff --git a/tests/pos/i16777.scala b/tests/pos/i16777.scala index 4218aea29d9f..302ace3ea9aa 100644 --- a/tests/pos/i16777.scala +++ b/tests/pos/i16777.scala @@ -1,4 +1,4 @@ -// scalac: -Ykind-projector:underscores +//> using options -Ykind-projector:underscores sealed abstract class Free[+S[_, _], +E, +A] { @inline final def flatMap[S1[e, a] >: S[e, a], B, E1 >: E](fun: A => Free[S1, E1, B]): Free[S1, E1, B] = Free.FlatMapped[S1, E, E1, A, B](this, fun) diff --git a/tests/pos/i16808.scala b/tests/pos/i16808.scala index 6b813c13818c..43e77634a535 100644 --- a/tests/pos/i16808.scala +++ b/tests/pos/i16808.scala @@ -1,4 +1,4 @@ -// scalac: -source future -deprecation -Xfatal-warnings +//> using options -source future -deprecation -Xfatal-warnings def collectKeys[A, B, C](xs: Map[A, B])(f: PartialFunction[A, C]): Map[C, B] = xs.collect{ case (f(c) , b) => (c, b) } diff --git a/tests/pos/i17230.min1.scala b/tests/pos/i17230.min1.scala index e2df63e168c1..9ab79433fae2 100644 --- a/tests/pos/i17230.min1.scala +++ b/tests/pos/i17230.min1.scala @@ -1,4 +1,4 @@ -// scalac: -Werror +//> using options -Werror trait Foo: type Bar[_] diff --git a/tests/pos/i17230.orig.scala b/tests/pos/i17230.orig.scala index d72a0082a116..279ae41fc32e 100644 --- a/tests/pos/i17230.orig.scala +++ b/tests/pos/i17230.orig.scala @@ -1,4 +1,4 @@ -// scalac: -Werror +//> using options -Werror import scala.util.* trait Transaction { diff --git a/tests/pos/i17257.min.scala b/tests/pos/i17257.min.scala index afdcb9c74564..f4e101cdbe21 100644 --- a/tests/pos/i17257.min.scala +++ b/tests/pos/i17257.min.scala @@ -1,4 +1,4 @@ -// scalac: -Yno-deep-subtypes:false +//> using options -Yno-deep-subtypes:false // Minimisation of tests/run-macros/i17257 // to understand how changes to match type reduction // impacted this use of Tuple.IsMappedBy. diff --git a/tests/pos/i18183.migration.scala b/tests/pos/i18183.migration.scala index 8a916ff17794..b361f578a428 100644 --- a/tests/pos/i18183.migration.scala +++ b/tests/pos/i18183.migration.scala @@ -1,4 +1,4 @@ -// scalac: -source:3.0-migration +//> using options -source:3.0-migration // A not-fully-minimal reproduction of the CI failure in http4s // While implementing the fix to name "shadowing" in implicit lookup. diff --git a/tests/pos/i7296.scala b/tests/pos/i7296.scala index 39f389729cc5..67fb3eee48a4 100644 --- a/tests/pos/i7296.scala +++ b/tests/pos/i7296.scala @@ -1,4 +1,4 @@ -// scalac: -source future -deprecation -Xfatal-warnings +//> using options -source future -deprecation -Xfatal-warnings class Foo: private var blah: Double = 0L diff --git a/tests/pos/i7424.scala b/tests/pos/i7424.scala index 33987610519e..416b57bfffe0 100644 --- a/tests/pos/i7424.scala +++ b/tests/pos/i7424.scala @@ -1,4 +1,4 @@ -// scalac: -Werror +//> using options -Werror object GADT { import =:=._ diff --git a/tests/pos/i7424b.scala b/tests/pos/i7424b.scala index 5fdf878a2330..5407270e1a97 100644 --- a/tests/pos/i7424b.scala +++ b/tests/pos/i7424b.scala @@ -1,4 +1,4 @@ -// scalac: -Werror +//> using options -Werror object GADT { import =:=._ diff --git a/tests/pos/i7424c.scala b/tests/pos/i7424c.scala index e27b17964253..9a02328f82a2 100644 --- a/tests/pos/i7424c.scala +++ b/tests/pos/i7424c.scala @@ -1,4 +1,4 @@ -// scalac: -Werror +//> using options -Werror object Main extends App: enum Extends[A, B]: case Ev[B, A <: B]() extends (A Extends B) diff --git a/tests/pos/i7575.scala b/tests/pos/i7575.scala index c3689afb6441..ea991e649e8c 100644 --- a/tests/pos/i7575.scala +++ b/tests/pos/i7575.scala @@ -1,3 +1,3 @@ -// scalac: -language:dynamics +//> using options -language:dynamics class Foo() extends Dynamic diff --git a/tests/pos/i7868.scala b/tests/pos/i7868.scala index a5d844414fb1..f4d7da6acb5b 100644 --- a/tests/pos/i7868.scala +++ b/tests/pos/i7868.scala @@ -1,4 +1,4 @@ -// scalac: -language:experimental.erasedDefinitions +//> using options -language:experimental.erasedDefinitions import language.experimental.namedTypeArguments import scala.compiletime.* diff --git a/tests/pos/i7878.scala b/tests/pos/i7878.scala index b3fd8a77fbfc..05a1b6093e6a 100644 --- a/tests/pos/i7878.scala +++ b/tests/pos/i7878.scala @@ -1,4 +1,4 @@ -// scalac: -language:experimental.erasedDefinitions +//> using options -language:experimental.erasedDefinitions object Boom { import scala.compiletime.* diff --git a/tests/pos/i8875.scala b/tests/pos/i8875.scala index bb50cd031847..c0de263417e0 100644 --- a/tests/pos/i8875.scala +++ b/tests/pos/i8875.scala @@ -1,4 +1,4 @@ -// scalac: -Xprint:getters +//> using options -Xprint:getters class A { extension (a: Int) { diff --git a/tests/pos/i8945.scala b/tests/pos/i8945.scala index a619bbf6be74..2ae8fc268cbf 100644 --- a/tests/pos/i8945.scala +++ b/tests/pos/i8945.scala @@ -1,4 +1,4 @@ -// scalac: -Yno-experimental +//> using options -Yno-experimental // src-2/MacroImpl.scala trait Context { diff --git a/tests/pos/i9267.scala b/tests/pos/i9267.scala index c92fd043f1aa..49f65ff5e3a1 100644 --- a/tests/pos/i9267.scala +++ b/tests/pos/i9267.scala @@ -1,3 +1,3 @@ -// scalac: -Ystop-after:erasure +//> using options -Ystop-after:erasure class A diff --git a/tests/pos/jdk-8-app.scala b/tests/pos/jdk-8-app.scala index 8d140691e375..593547b6e377 100644 --- a/tests/pos/jdk-8-app.scala +++ b/tests/pos/jdk-8-app.scala @@ -1,4 +1,4 @@ -// scalac: -release:8 +//> using options -release:8 import java.time.LocalDate diff --git a/tests/pos/kind-projector-underscores.scala b/tests/pos/kind-projector-underscores.scala index 2e40c639b01d..f72a300a64eb 100644 --- a/tests/pos/kind-projector-underscores.scala +++ b/tests/pos/kind-projector-underscores.scala @@ -1,4 +1,4 @@ -// scalac: -Ykind-projector:underscores +//> using options -Ykind-projector:underscores package kind_projector diff --git a/tests/pos/kind-projector.scala b/tests/pos/kind-projector.scala index e7b864c5357e..ff787d0111e2 100644 --- a/tests/pos/kind-projector.scala +++ b/tests/pos/kind-projector.scala @@ -1,4 +1,4 @@ -// scalac: -Ykind-projector +//> using options -Ykind-projector package kind_projector diff --git a/tests/pos/multiple-additional-imports.scala b/tests/pos/multiple-additional-imports.scala index a86c7e8fc342..d5afc7ada7df 100644 --- a/tests/pos/multiple-additional-imports.scala +++ b/tests/pos/multiple-additional-imports.scala @@ -1,4 +1,4 @@ -// scalac: -Yimports:scala,java.lang,scala.Predef,scala.annotation,scala.util.matching +//> using options -Yimports:scala,java.lang,scala.Predef,scala.annotation,scala.util.matching class annotation extends Annotation val s: String = "str" diff --git a/tests/pos/single-additional-import.scala b/tests/pos/single-additional-import.scala index d8ca5b54e05e..432826b74883 100644 --- a/tests/pos/single-additional-import.scala +++ b/tests/pos/single-additional-import.scala @@ -1,2 +1,2 @@ -// scalac: -Yimports:scala.annotation +//> using options -Yimports:scala.annotation class annotation extends Annotation diff --git a/tests/pos/t16827.scala b/tests/pos/t16827.scala index 17122fd9b580..ba11aac71cba 100644 --- a/tests/pos/t16827.scala +++ b/tests/pos/t16827.scala @@ -1,4 +1,4 @@ -// scalac: -Werror +//> using options -Werror trait Outer[F[_]]: sealed trait Inner diff --git a/tests/pos/t6963c.scala b/tests/pos/t6963c.scala index baf356ab26b7..9154c0506d23 100644 --- a/tests/pos/t6963c.scala +++ b/tests/pos/t6963c.scala @@ -1,4 +1,4 @@ -// scalac: -Xmigration:2.9 -Xfatal-warnings +//> using options -Xmigration:2.9 -Xfatal-warnings // import collection.Seq object Test { diff --git a/tests/pos/tailrec.scala b/tests/pos/tailrec.scala index d461e1872384..95e667c07515 100644 --- a/tests/pos/tailrec.scala +++ b/tests/pos/tailrec.scala @@ -1,4 +1,4 @@ -// scalac: -language:experimental.erasedDefinitions +//> using options -language:experimental.erasedDefinitions import scala.annotation.tailrec diff --git a/tests/pos/typeclass-scaling.scala b/tests/pos/typeclass-scaling.scala index 6f837a2b423b..0db663de4989 100644 --- a/tests/pos/typeclass-scaling.scala +++ b/tests/pos/typeclass-scaling.scala @@ -1,4 +1,4 @@ -// scalac: -Xmax-inlines 40 +//> using options -Xmax-inlines 40 import scala.collection.mutable import scala.annotation.tailrec diff --git a/tests/pos/xfatalWarnings.scala b/tests/pos/xfatalWarnings.scala index 9cda8e2beed8..ba278fc87aa3 100644 --- a/tests/pos/xfatalWarnings.scala +++ b/tests/pos/xfatalWarnings.scala @@ -1,4 +1,4 @@ -// scalac: -nowarn -Xfatal-warnings +//> using options -nowarn -Xfatal-warnings // succeeds despite -Xfatal-warnings because of -nowarn object xfatalWarnings { diff --git a/tests/run-macros/Xmacro-settings-compileTimeEnv/Test.scala b/tests/run-macros/Xmacro-settings-compileTimeEnv/Test.scala index fb417e8dcb9e..620d2b85d185 100644 --- a/tests/run-macros/Xmacro-settings-compileTimeEnv/Test.scala +++ b/tests/run-macros/Xmacro-settings-compileTimeEnv/Test.scala @@ -1,4 +1,4 @@ -// scalac: -Xmacro-settings:a,b=1,c.b.a=x.y.z=1,myLogger.level=INFO +//> using options -Xmacro-settings:a,b=1,c.b.a=x.y.z=1,myLogger.level=INFO import scala.compiletime.* diff --git a/tests/run-macros/Xmacro-settings-simple/Test.scala b/tests/run-macros/Xmacro-settings-simple/Test.scala index 7ebb5bca1429..59289bc3642b 100644 --- a/tests/run-macros/Xmacro-settings-simple/Test.scala +++ b/tests/run-macros/Xmacro-settings-simple/Test.scala @@ -1,4 +1,4 @@ -// scalac: -Xmacro-settings:one,two,three +//> using options -Xmacro-settings:one,two,three import x.* diff --git a/tests/run-macros/i12351/Test_2.scala b/tests/run-macros/i12351/Test_2.scala index 3007a5d652e0..e480b3c7e86e 100644 --- a/tests/run-macros/i12351/Test_2.scala +++ b/tests/run-macros/i12351/Test_2.scala @@ -1,4 +1,4 @@ -// scalac: -Yread-docs +//> using options -Yread-docs @main def Test(): Unit = { println(getDocString[Data]) diff --git a/tests/run-macros/i12352/Main.scala b/tests/run-macros/i12352/Main.scala index 94d5453d0b57..b62bd80eaf2c 100644 --- a/tests/run-macros/i12352/Main.scala +++ b/tests/run-macros/i12352/Main.scala @@ -1,4 +1,4 @@ -// scalac: -Yread-docs +//> using options -Yread-docs @main def Test(): Unit = { val res = getDocString[scala.quoted.Quotes] diff --git a/tests/run-macros/tasty-definitions-1/quoted_2.scala b/tests/run-macros/tasty-definitions-1/quoted_2.scala index 43a2ecb14ee3..47167a52f1d9 100644 --- a/tests/run-macros/tasty-definitions-1/quoted_2.scala +++ b/tests/run-macros/tasty-definitions-1/quoted_2.scala @@ -1,4 +1,4 @@ -// scalac: -Yretain-trees +//> using options -Yretain-trees object Test { def main(args: Array[String]): Unit = { diff --git a/tests/run-macros/tasty-definitions-2/Test_2.scala b/tests/run-macros/tasty-definitions-2/Test_2.scala index a7146b0cc6ca..d95b8cafddf6 100644 --- a/tests/run-macros/tasty-definitions-2/Test_2.scala +++ b/tests/run-macros/tasty-definitions-2/Test_2.scala @@ -1,4 +1,4 @@ -// scalac: -Yretain-trees +//> using options -Yretain-trees object Test { def main(args: Array[String]): Unit = { diff --git a/tests/run-macros/tasty-definitions-3/Test_2.scala b/tests/run-macros/tasty-definitions-3/Test_2.scala index ec01ccb622a1..15d4624883ab 100644 --- a/tests/run-macros/tasty-definitions-3/Test_2.scala +++ b/tests/run-macros/tasty-definitions-3/Test_2.scala @@ -1,4 +1,4 @@ -// scalac: -Yretain-trees +//> using options -Yretain-trees object Test { diff --git a/tests/run-macros/tasty-extractors-owners/quoted_2.scala b/tests/run-macros/tasty-extractors-owners/quoted_2.scala index 15eac0a8a2c5..75f6585676cc 100644 --- a/tests/run-macros/tasty-extractors-owners/quoted_2.scala +++ b/tests/run-macros/tasty-extractors-owners/quoted_2.scala @@ -1,4 +1,4 @@ -// scalac: -Yretain-trees +//> using options -Yretain-trees import Macros.* diff --git a/tests/run-macros/tasty-load-tree-1/quoted_2.scala b/tests/run-macros/tasty-load-tree-1/quoted_2.scala index d30fc7c83531..e7e47cb55516 100644 --- a/tests/run-macros/tasty-load-tree-1/quoted_2.scala +++ b/tests/run-macros/tasty-load-tree-1/quoted_2.scala @@ -1,4 +1,4 @@ -// scalac: -Yretain-trees +//> using options -Yretain-trees object Test { def main(args: Array[String]): Unit = { diff --git a/tests/run-macros/tasty-load-tree-2/quoted_2.scala b/tests/run-macros/tasty-load-tree-2/quoted_2.scala index 1a5a1674fc13..35362f8c80e9 100644 --- a/tests/run-macros/tasty-load-tree-2/quoted_2.scala +++ b/tests/run-macros/tasty-load-tree-2/quoted_2.scala @@ -1,4 +1,4 @@ -// scalac: -Yretain-trees +//> using options -Yretain-trees object Test { def main(args: Array[String]): Unit = { diff --git a/tests/run/convertible.scala b/tests/run/convertible.scala index 6c199c564d52..0670d1949fd9 100644 --- a/tests/run/convertible.scala +++ b/tests/run/convertible.scala @@ -1,4 +1,4 @@ -// scalac: -Xfatal-warnings +//> using options -Xfatal-warnings import language.experimental.into diff --git a/tests/run/defaults-serizaliable-no-forwarders.scala b/tests/run/defaults-serizaliable-no-forwarders.scala index 5ecdb3b41c57..93ed985ce2aa 100644 --- a/tests/run/defaults-serizaliable-no-forwarders.scala +++ b/tests/run/defaults-serizaliable-no-forwarders.scala @@ -1,4 +1,4 @@ -// scalac: -Xmixin-force-forwarders:false +//> using options -Xmixin-force-forwarders:false // scalajs: --skip import java.io.{ByteArrayInputStream, ByteArrayOutputStream, ObjectInputStream, ObjectOutputStream} diff --git a/tests/run/erased-1.scala b/tests/run/erased-1.scala index be73e57ff9c5..9875d7b1d68b 100644 --- a/tests/run/erased-1.scala +++ b/tests/run/erased-1.scala @@ -1,4 +1,4 @@ -// scalac: -language:experimental.erasedDefinitions +//> using options -language:experimental.erasedDefinitions object Test { diff --git a/tests/run/erased-10.scala b/tests/run/erased-10.scala index 2954b923bab6..004d07b4de37 100644 --- a/tests/run/erased-10.scala +++ b/tests/run/erased-10.scala @@ -1,4 +1,4 @@ -// scalac: -language:experimental.erasedDefinitions +//> using options -language:experimental.erasedDefinitions object Test { diff --git a/tests/run/erased-11.scala b/tests/run/erased-11.scala index a3490af973e1..0963f5105142 100644 --- a/tests/run/erased-11.scala +++ b/tests/run/erased-11.scala @@ -1,4 +1,4 @@ -// scalac: -language:experimental.erasedDefinitions +//> using options -language:experimental.erasedDefinitions object Test { diff --git a/tests/run/erased-12.scala b/tests/run/erased-12.scala index 9f60594137d0..be641b8b95c2 100644 --- a/tests/run/erased-12.scala +++ b/tests/run/erased-12.scala @@ -1,4 +1,4 @@ -// scalac: -language:experimental.erasedDefinitions +//> using options -language:experimental.erasedDefinitions object Test { diff --git a/tests/run/erased-13.scala b/tests/run/erased-13.scala index c49e003330b9..55dce8ac3e7b 100644 --- a/tests/run/erased-13.scala +++ b/tests/run/erased-13.scala @@ -1,4 +1,4 @@ -// scalac: -language:experimental.erasedDefinitions +//> using options -language:experimental.erasedDefinitions object Test { diff --git a/tests/run/erased-14.scala b/tests/run/erased-14.scala index 07b0ede25807..7d10af210a41 100644 --- a/tests/run/erased-14.scala +++ b/tests/run/erased-14.scala @@ -1,4 +1,4 @@ -// scalac: -language:experimental.erasedDefinitions +//> using options -language:experimental.erasedDefinitions object Test { diff --git a/tests/run/erased-15.scala b/tests/run/erased-15.scala index 282c5510c51a..ac3adc428ffb 100644 --- a/tests/run/erased-15.scala +++ b/tests/run/erased-15.scala @@ -1,4 +1,4 @@ -// scalac: -language:experimental.erasedDefinitions +//> using options -language:experimental.erasedDefinitions object Test { diff --git a/tests/run/erased-16.scala b/tests/run/erased-16.scala index 8549a4344351..f879165bffa1 100644 --- a/tests/run/erased-16.scala +++ b/tests/run/erased-16.scala @@ -1,4 +1,4 @@ -// scalac: -language:experimental.erasedDefinitions +//> using options -language:experimental.erasedDefinitions object Test { diff --git a/tests/run/erased-17.scala b/tests/run/erased-17.scala index 9857a7a77a95..b64b01952192 100644 --- a/tests/run/erased-17.scala +++ b/tests/run/erased-17.scala @@ -1,4 +1,4 @@ -// scalac: -language:experimental.erasedDefinitions +//> using options -language:experimental.erasedDefinitions object Test { diff --git a/tests/run/erased-18.scala b/tests/run/erased-18.scala index 146537389990..46f7e44c7309 100644 --- a/tests/run/erased-18.scala +++ b/tests/run/erased-18.scala @@ -1,4 +1,4 @@ -// scalac: -language:experimental.erasedDefinitions +//> using options -language:experimental.erasedDefinitions object Test { diff --git a/tests/run/erased-19.scala b/tests/run/erased-19.scala index 114abf2eb42c..4bbcd1dd3bba 100644 --- a/tests/run/erased-19.scala +++ b/tests/run/erased-19.scala @@ -1,4 +1,4 @@ -// scalac: -language:experimental.erasedDefinitions +//> using options -language:experimental.erasedDefinitions object Test { diff --git a/tests/run/erased-20.scala b/tests/run/erased-20.scala index 0d92636b7acb..7d07260c2d08 100644 --- a/tests/run/erased-20.scala +++ b/tests/run/erased-20.scala @@ -1,4 +1,4 @@ -// scalac: -language:experimental.erasedDefinitions +//> using options -language:experimental.erasedDefinitions object Test { diff --git a/tests/run/erased-21.scala b/tests/run/erased-21.scala index e64ddda8f778..804f8f9c53ee 100644 --- a/tests/run/erased-21.scala +++ b/tests/run/erased-21.scala @@ -1,4 +1,4 @@ -// scalac: -language:experimental.erasedDefinitions +//> using options -language:experimental.erasedDefinitions object Test { diff --git a/tests/run/erased-22.scala b/tests/run/erased-22.scala index 7a92c9686f04..df05773e00b1 100644 --- a/tests/run/erased-22.scala +++ b/tests/run/erased-22.scala @@ -1,4 +1,4 @@ -// scalac: -language:experimental.erasedDefinitions +//> using options -language:experimental.erasedDefinitions object Test { diff --git a/tests/run/erased-25.scala b/tests/run/erased-25.scala index 6ba06bc7cffa..bcfe4fe6d444 100644 --- a/tests/run/erased-25.scala +++ b/tests/run/erased-25.scala @@ -1,4 +1,4 @@ -// scalac: -language:experimental.erasedDefinitions +//> using options -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 0ebc117e84d2..b3efd62bb9f6 100644 --- a/tests/run/erased-26.scala +++ b/tests/run/erased-26.scala @@ -1,4 +1,4 @@ -// scalac: -language:experimental.erasedDefinitions +//> using options -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 86faa3a4f0f3..271a9ca47db9 100644 --- a/tests/run/erased-27.scala +++ b/tests/run/erased-27.scala @@ -1,4 +1,4 @@ -// scalac: -language:experimental.erasedDefinitions +//> using options -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 7081ec779402..ae33b3dc5844 100644 --- a/tests/run/erased-28.scala +++ b/tests/run/erased-28.scala @@ -1,4 +1,4 @@ -// scalac: -language:experimental.erasedDefinitions +//> using options -language:experimental.erasedDefinitions object Test { var a = true diff --git a/tests/run/erased-3.scala b/tests/run/erased-3.scala index aad90ef06fd7..a138e7dfd6f7 100644 --- a/tests/run/erased-3.scala +++ b/tests/run/erased-3.scala @@ -1,4 +1,4 @@ -// scalac: -language:experimental.erasedDefinitions +//> using options -language:experimental.erasedDefinitions object Test { diff --git a/tests/run/erased-4.scala b/tests/run/erased-4.scala index 7650b6b513e9..2e1e2ad64bbf 100644 --- a/tests/run/erased-4.scala +++ b/tests/run/erased-4.scala @@ -1,4 +1,4 @@ -// scalac: -language:experimental.erasedDefinitions +//> using options -language:experimental.erasedDefinitions object Test { diff --git a/tests/run/erased-5.scala b/tests/run/erased-5.scala index ef813440576f..ced18c2426be 100644 --- a/tests/run/erased-5.scala +++ b/tests/run/erased-5.scala @@ -1,4 +1,4 @@ -// scalac: -language:experimental.erasedDefinitions +//> using options -language:experimental.erasedDefinitions object Test { diff --git a/tests/run/erased-6.scala b/tests/run/erased-6.scala index c1c2377175de..4577aa7a03e9 100644 --- a/tests/run/erased-6.scala +++ b/tests/run/erased-6.scala @@ -1,4 +1,4 @@ -// scalac: -language:experimental.erasedDefinitions +//> using options -language:experimental.erasedDefinitions object Test { diff --git a/tests/run/erased-7.scala b/tests/run/erased-7.scala index 8eca420c9768..080882503b24 100644 --- a/tests/run/erased-7.scala +++ b/tests/run/erased-7.scala @@ -1,4 +1,4 @@ -// scalac: -language:experimental.erasedDefinitions +//> using options -language:experimental.erasedDefinitions object Test { diff --git a/tests/run/erased-8.scala b/tests/run/erased-8.scala index ae2b79cd8544..ef79e27b75fb 100644 --- a/tests/run/erased-8.scala +++ b/tests/run/erased-8.scala @@ -1,4 +1,4 @@ -// scalac: -language:experimental.erasedDefinitions +//> using options -language:experimental.erasedDefinitions object Test { diff --git a/tests/run/erased-9.scala b/tests/run/erased-9.scala index 01ae56f4ec79..1c38d202640d 100644 --- a/tests/run/erased-9.scala +++ b/tests/run/erased-9.scala @@ -1,4 +1,4 @@ -// scalac: -language:experimental.erasedDefinitions +//> using options -language:experimental.erasedDefinitions object Test { diff --git a/tests/run/erased-class-are-erased.scala b/tests/run/erased-class-are-erased.scala index e91019e9eabb..45dc5206e275 100644 --- a/tests/run/erased-class-are-erased.scala +++ b/tests/run/erased-class-are-erased.scala @@ -1,4 +1,4 @@ -// scalac: -language:experimental.erasedDefinitions +//> using options -language:experimental.erasedDefinitions object Test { erased class Erased() { diff --git a/tests/run/erased-frameless.scala b/tests/run/erased-frameless.scala index a61f7a025593..fe654639492a 100644 --- a/tests/run/erased-frameless.scala +++ b/tests/run/erased-frameless.scala @@ -1,4 +1,4 @@ -// scalac: -language:experimental.erasedDefinitions +//> using options -language:experimental.erasedDefinitions import scala.annotation.implicitNotFound diff --git a/tests/run/erased-lambdas.scala b/tests/run/erased-lambdas.scala index 2e0851f4f054..9c107e0fa0d4 100644 --- a/tests/run/erased-lambdas.scala +++ b/tests/run/erased-lambdas.scala @@ -1,4 +1,4 @@ -// scalac: -language:experimental.erasedDefinitions +//> using options -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 458efd49cc53..c84f1619366d 100644 --- a/tests/run/erased-machine-state.scala +++ b/tests/run/erased-machine-state.scala @@ -1,4 +1,4 @@ -// scalac: -language:experimental.erasedDefinitions +//> using options -language:experimental.erasedDefinitions import scala.annotation.implicitNotFound diff --git a/tests/run/erased-poly-ref.scala b/tests/run/erased-poly-ref.scala index 46932792eb9a..59badb71255d 100644 --- a/tests/run/erased-poly-ref.scala +++ b/tests/run/erased-poly-ref.scala @@ -1,4 +1,4 @@ -// scalac: -language:experimental.erasedDefinitions +//> using options -language:experimental.erasedDefinitions object Test { diff --git a/tests/run/erased-select-prefix.scala b/tests/run/erased-select-prefix.scala index e82994a59932..b877a0d209d7 100644 --- a/tests/run/erased-select-prefix.scala +++ b/tests/run/erased-select-prefix.scala @@ -1,4 +1,4 @@ -// scalac: -language:experimental.erasedDefinitions +//> using options -language:experimental.erasedDefinitions object Test { diff --git a/tests/run/erased-value-class.scala b/tests/run/erased-value-class.scala index 918f6af902a3..37cc233d4aca 100644 --- a/tests/run/erased-value-class.scala +++ b/tests/run/erased-value-class.scala @@ -1,4 +1,4 @@ -// scalac: -language:experimental.erasedDefinitions +//> using options -language:experimental.erasedDefinitions object Test { diff --git a/tests/run/generic-java-signatures-erased.scala b/tests/run/generic-java-signatures-erased.scala index 954c98e1ddee..31c6e07599ad 100644 --- a/tests/run/generic-java-signatures-erased.scala +++ b/tests/run/generic-java-signatures-erased.scala @@ -1,4 +1,4 @@ -// scalac: -language:experimental.erasedDefinitions +//> using options -language:experimental.erasedDefinitions // scalajs: --skip object MyErased { diff --git a/tests/run/i11050.scala b/tests/run/i11050.scala index 4c275e28195f..90a6ec84df85 100644 --- a/tests/run/i11050.scala +++ b/tests/run/i11050.scala @@ -1,4 +1,4 @@ -// scalac: -Xfatal-warnings +//> using options -Xfatal-warnings import scala.compiletime.* import scala.deriving.* diff --git a/tests/run/i11996.scala b/tests/run/i11996.scala index 5cf3cfd0f428..9724e12b575e 100644 --- a/tests/run/i11996.scala +++ b/tests/run/i11996.scala @@ -1,4 +1,4 @@ -// scalac: -language:experimental.erasedDefinitions +//> using options -language:experimental.erasedDefinitions final class UnivEq[A] diff --git a/tests/run/i5606.scala b/tests/run/i5606.scala index 1ee6fed27091..7c3c3ae4fc40 100644 --- a/tests/run/i5606.scala +++ b/tests/run/i5606.scala @@ -1,4 +1,4 @@ -// scalac: -Yretain-trees +//> using options -Yretain-trees object Test extends App { diff --git a/tests/run/no-useless-forwarders.scala b/tests/run/no-useless-forwarders.scala index dc465b24ef1e..289bf64fa9ac 100644 --- a/tests/run/no-useless-forwarders.scala +++ b/tests/run/no-useless-forwarders.scala @@ -1,4 +1,4 @@ -// scalac: -Xmixin-force-forwarders:false +//> using options -Xmixin-force-forwarders:false // scalajs: --skip trait A { diff --git a/tests/run/string-switch.scala b/tests/run/string-switch.scala index 0c25661972de..ece1cb088926 100644 --- a/tests/run/string-switch.scala +++ b/tests/run/string-switch.scala @@ -1,4 +1,4 @@ -// scalac: -Werror +//> using options -Werror import annotation.switch import util.Try