Skip to content

Commit

Permalink
[nomerge] on 2.12, -release should not set -target
Browse files Browse the repository at this point in the history
  • Loading branch information
lrytz committed Aug 15, 2022
1 parent 5ff747f commit 0ae79da
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ trait StandardScalaSettings { _: MutableSettings =>
}
}
.withAbbreviation("--target")
def targetValue: String = releaseValue.getOrElse(target.value)
// Unlike 2.13, don't use `releaseValue.getOrElse(target.value)`, because 2.12 doesn't have a fix for scala-dev#408
def targetValue: String = target.value
val unchecked = BooleanSetting ("-unchecked", "Enable additional warnings where generated code depends on assumptions. See also -Wconf.") withAbbreviation "--unchecked" withPostSetHook { s =>
if (s.value) Wconf.tryToSet(List(s"cat=unchecked:w"))
else Wconf.tryToSet(List(s"cat=unchecked:s"))
Expand Down
8 changes: 8 additions & 0 deletions test/files/run/t12543-target.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// javaVersion: 11+
// scalac: -release:11

trait T { val x = 42 }
class C extends T
object Test {
def main(args: Array[String]): Unit = { new C(); () }
}

0 comments on commit 0ae79da

Please sign in to comment.