Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lift Scala Settings from experimental to stabilized #20199

Merged
merged 19 commits into from
May 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion community-build/community-projects/AsyncFile
Submodule AsyncFile updated 1 files
+1 −1 build.sbt
2 changes: 1 addition & 1 deletion community-build/community-projects/Equal
Submodule Equal updated 1 files
+1 −1 build.sbt
2 changes: 1 addition & 1 deletion community-build/community-projects/FingerTree
Submodule FingerTree updated 1 files
+1 −1 build.sbt
2 changes: 1 addition & 1 deletion community-build/community-projects/Log
Submodule Log updated 1 files
+1 −1 build.sbt
2 changes: 1 addition & 1 deletion community-build/community-projects/Lucre
Submodule Lucre updated 1 files
+1 −1 build.sbt
2 changes: 1 addition & 1 deletion community-build/community-projects/Model
Submodule Model updated 1 files
+1 −1 build.sbt
2 changes: 1 addition & 1 deletion community-build/community-projects/Numbers
Submodule Numbers updated 1 files
+1 −1 build.sbt
2 changes: 1 addition & 1 deletion community-build/community-projects/Serial
Submodule Serial updated 1 files
+1 −1 build.sbt
2 changes: 1 addition & 1 deletion community-build/community-projects/Span
Submodule Span updated 1 files
+1 −1 build.sbt
2 changes: 1 addition & 1 deletion community-build/community-projects/discipline
Submodule discipline updated 1 files
+2 −1 build.sbt
2 changes: 1 addition & 1 deletion community-build/community-projects/discipline-munit
Submodule discipline-munit updated 1 files
+2 −0 build.sbt
2 changes: 1 addition & 1 deletion community-build/community-projects/discipline-specs2
Submodule discipline-specs2 updated 1 files
+2 −0 build.sbt
2 changes: 1 addition & 1 deletion community-build/community-projects/fs2
Submodule fs2 updated 1 files
+2 −0 build.sbt
2 changes: 1 addition & 1 deletion community-build/community-projects/scala-stm
Submodule scala-stm updated 1 files
+1 −1 build.sbt
2 changes: 1 addition & 1 deletion community-build/community-projects/scodec
Submodule scodec updated 1 files
+5 −1 build.sbt
2 changes: 1 addition & 1 deletion community-build/community-projects/verify
Submodule verify updated 1 files
+0 −1 build.sbt
19 changes: 9 additions & 10 deletions community-build/src/scala/dotty/communitybuild/projects.scala
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ final case class SbtCommunityProject(
object SbtCommunityProject:
def scalacOptions = List(
"-Xcheck-macros",
"-Ysafe-init",
"-Wsafe-init",
)

object projects:
Expand Down Expand Up @@ -362,7 +362,7 @@ object projects:
project = "shapeless-3",
sbtTestCommand = "testJVM; testJS",
sbtDocCommand = forceDoc("typeable", "deriving"),
scalacOptions = "-source" :: "3.3" :: SbtCommunityProject.scalacOptions.filter(_ != "-Ysafe-init"), // due to -Xfatal-warnings
scalacOptions = "-source" :: "3.3" :: SbtCommunityProject.scalacOptions.filter(_ != "-Wsafe-init"), // due to -Xfatal-warnings
)

lazy val xmlInterpolator = SbtCommunityProject(
Expand Down Expand Up @@ -429,7 +429,7 @@ object projects:
sbtTestCommand = "unitTests/test",
// Adds <empty> package
sbtDocCommand = "coreJVM/doc",
scalacOptions = SbtCommunityProject.scalacOptions.filter(_ != "-Ysafe-init"),
scalacOptions = SbtCommunityProject.scalacOptions.filter(_ != "-Wsafe-init"),
dependencies = List(munit, scodecBits),
)

Expand Down Expand Up @@ -510,7 +510,7 @@ object projects:
project = "discipline",
sbtTestCommand = "coreJVM/test;coreJS/test",
sbtPublishCommand = "set every credentials := Nil;coreJVM/publishLocal;coreJS/publishLocal",
scalacOptions = SbtCommunityProject.scalacOptions.filter(_ != "-Ysafe-init"),
scalacOptions = SbtCommunityProject.scalacOptions.filter(_ != "-Wsafe-init"),
dependencies = List(scalacheck)
)

Expand All @@ -526,7 +526,7 @@ object projects:
sbtTestCommand = "test",
sbtPublishCommand = "coreJVM/publishLocal;coreJS/publishLocal",
dependencies = List(discipline),
scalacOptions = SbtCommunityProject.scalacOptions.filter(_ != "-Ysafe-init")
scalacOptions = SbtCommunityProject.scalacOptions.filter(_ != "-Wsafe-init")
)

lazy val simulacrumScalafixAnnotations = SbtCommunityProject(
Expand All @@ -540,8 +540,7 @@ object projects:
sbtTestCommand = "set Global/scalaJSStage := FastOptStage;rootJVM/test;rootJS/test",
sbtPublishCommand = "rootJVM/publishLocal;rootJS/publishLocal",
dependencies = List(discipline, disciplineMunit, scalacheck, simulacrumScalafixAnnotations),
scalacOptions = SbtCommunityProject.scalacOptions.filter(_ != "-Ysafe-init") // disable -Ysafe-init, due to -Xfatal-warning

scalacOptions = SbtCommunityProject.scalacOptions.filter(_ != "-Wsafe-init") // disable -Ysafe-init or -Wsafe-init, due to -Xfatal-warning
)

lazy val catsMtl = SbtCommunityProject(
Expand Down Expand Up @@ -656,7 +655,7 @@ object projects:
"""set actorTests/Compile/scalacOptions -= "-Xfatal-warnings"""",
"akka-actor-tests/Test/compile",
).mkString("; "),
scalacOptions = SbtCommunityProject.scalacOptions.filter(_ != "-Ysafe-init"),
scalacOptions = SbtCommunityProject.scalacOptions.filter(_ != "-Wsafe-init"),
dependencies = List(scalatest, scalatestplusJunit, scalatestplusScalacheck)
)

Expand Down Expand Up @@ -707,7 +706,7 @@ object projects:
project = "fs2",
sbtTestCommand = "coreJVM/test; coreJS/test", // io/test requires JDK9+
sbtPublishCommand = "coreJVM/publishLocal; coreJS/publishLocal",
scalacOptions = SbtCommunityProject.scalacOptions.filter(_ != "-Ysafe-init"),
scalacOptions = SbtCommunityProject.scalacOptions.filter(_ != "-Wsafe-init"),
dependencies = List(cats, catsEffect3, munitCatsEffect, scalacheckEffect, scodecBits)
)

Expand Down Expand Up @@ -744,7 +743,7 @@ object projects:
project = "http4s",
sbtTestCommand = """set ThisBuild / tlFatalWarnings := false; rootJVM/test""",
sbtPublishCommand = "publishLocal",
scalacOptions = SbtCommunityProject.scalacOptions.filter(_ != "-Ysafe-init"),
scalacOptions = SbtCommunityProject.scalacOptions.filter(_ != "-Wsafe-init"),
dependencies = List(cats, catsEffect3, fs2, disciplineMunit, scalacheckEffect)
)

Expand Down
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/backend/jvm/BCodeHelpers.scala
Original file line number Diff line number Diff line change
Expand Up @@ -823,7 +823,7 @@ trait BCodeHelpers extends BCodeIdiomatic {
// without it. This is particularly bad because the availability of
// generic information could disappear as a consequence of a seemingly
// unrelated change.
ctx.base.settings.YnoGenericSig.value
ctx.base.settings.XnoGenericSig.value
|| sym.is(Artifact)
|| sym.isAllOf(LiftedMethod)
|| sym.is(Bridge)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,12 +121,14 @@ object PostProcessorFrontendAccess {
case (None, None) => "8" // least supported version by default

override val debug: Boolean = ctx.debug
override val dumpClassesDirectory: Option[String] = s.Ydumpclasses.valueSetByUser
override val dumpClassesDirectory: Option[String] = s.Xdumpclasses.valueSetByUser
override val outputDirectory: AbstractFile = s.outputDir.value
override val mainClass: Option[String] = s.XmainClass.valueSetByUser
override val jarCompressionLevel: Int = s.YjarCompressionLevel.value
override val jarCompressionLevel: Int = s.XjarCompressionLevel.value
override val backendParallelism: Int = s.YbackendParallelism.value
override val backendMaxWorkerQueue: Option[Int] = s.YbackendWorkerQueue.valueSetByUser

@annotation.nowarn("cat=deprecation")
override val outputOnlyTasty: Boolean = s.YoutputOnlyTasty.value
}

Expand Down
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/Driver.scala
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class Driver {
Positioned.init(using ictx)

inContext(ictx) {
if !ctx.settings.YdropComments.value || ctx.settings.YreadComments.value then
if !ctx.settings.XdropComments.value || ctx.settings.XreadComments.value then
ictx.setProperty(ContextDoc, new ContextDocstrings)
val fileNamesOrNone = command.checkUsage(summary, sourcesRequired)(using ctx.settings)(using ctx.settingsState)
fileNamesOrNone.map { fileNames =>
Expand Down
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/Run.scala
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ class Run(comp: Compiler, ictx: Context) extends ImplicitRunInfo with Constraint
runCtx.withProgressCallback: cb =>
_progress = Progress(cb, this, fusedPhases.map(_.traversals).sum)
val cancelAsyncTasty: () => Unit =
if !myAsyncTastyWritten && Phases.picklerPhase.exists && !ctx.settings.YearlyTastyOutput.isDefault then
if !myAsyncTastyWritten && Phases.picklerPhase.exists && !ctx.settings.XearlyTastyOutput.isDefault then
initializeAsyncTasty()
else () => {}

Expand Down
3 changes: 2 additions & 1 deletion compiler/src/dotty/tools/dotc/config/CliCommand.scala
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ trait CliCommand:
def defaultValue = s.default match
case _: Int | _: String => s.default.toString
case _ => ""
val info = List(shortHelp(s), if defaultValue.nonEmpty then s"Default $defaultValue" else "", if s.legalChoices.nonEmpty then s"Choices : ${s.legalChoices}" else "")
val deprecationMessage = s.deprecation.map(d => s"Option deprecated.\n${d.msg}").getOrElse("")
val info = List(deprecationMessage, shortHelp(s), if defaultValue.nonEmpty then s"Default $defaultValue" else "", if s.legalChoices.nonEmpty then s"Choices : ${s.legalChoices}" else "")
(s.name, info.filter(_.nonEmpty).mkString("\n"))
end help

Expand Down
Loading
Loading