File tree 2 files changed +21
-1
lines changed
integration/src/test/scala/scala/cli/integration
options/src/main/scala/scala/build/options
2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -495,4 +495,23 @@ class SipScalaTests extends ScalaCliSuite {
495
495
expect(res.exitCode == 0 )
496
496
}
497
497
}
498
+
499
+ test(" consecutive -language:* flags are not ignored" ) {
500
+ val sourceFileName = " example.scala"
501
+ TestInputs (os.rel / sourceFileName ->
502
+ """ //> using scala 3.3.1
503
+ |//> using options -Yexplicit-nulls -language:fewerBraces -language:strictEquality
504
+ |def repro[A](as: List[A]): List[A] =
505
+ | as match
506
+ | case Nil => Nil
507
+ | case _ => ???
508
+ |""" .stripMargin).fromRoot { root =>
509
+ val res = os.proc(TestUtil .cli, " compile" , sourceFileName)
510
+ .call(cwd = root, check = false , stderr = os.Pipe )
511
+ expect(res.exitCode == 1 )
512
+ val expectedError =
513
+ " Values of types object scala.collection.immutable.Nil and List[A] cannot be compared with == or !="
514
+ expect(res.err.trim().contains(expectedError))
515
+ }
516
+ }
498
517
}
Original file line number Diff line number Diff line change @@ -15,7 +15,8 @@ final case class ScalacOpt(value: String) {
15
15
object ScalacOpt {
16
16
private val repeatingKeys = Set (
17
17
" -Xplugin:" ,
18
- " -P" // plugin options
18
+ " -P" , // plugin options
19
+ " -language:"
19
20
)
20
21
21
22
implicit val hashedType : HashedType [ScalacOpt ] = {
You can’t perform that action at this time.
0 commit comments