Skip to content

Commit ad81b6f

Browse files
committed
Updates to submodules, remove unnecessary changes, revert Xlint changes
1 parent 93f3ff7 commit ad81b6f

File tree

9 files changed

+41
-49
lines changed

9 files changed

+41
-49
lines changed
Submodule fs2 updated 1 file
Submodule scodec updated 1 file

community-build/src/scala/dotty/communitybuild/projects.scala

+8-8
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ object projects:
362362
project = "shapeless-3",
363363
sbtTestCommand = "testJVM; testJS",
364364
sbtDocCommand = forceDoc("typeable", "deriving"),
365-
scalacOptions = "-source" :: "3.3" :: SbtCommunityProject.scalacOptions.filter(flag => flag != "-Ysafe-init" && flag != "-Wsafe-init"), // due to -Xfatal-warnings
365+
scalacOptions = "-source" :: "3.3" :: SbtCommunityProject.scalacOptions.filter(_ != "-Wsafe-init"), // due to -Xfatal-warnings
366366
)
367367

368368
lazy val xmlInterpolator = SbtCommunityProject(
@@ -429,7 +429,7 @@ object projects:
429429
sbtTestCommand = "unitTests/test",
430430
// Adds <empty> package
431431
sbtDocCommand = "coreJVM/doc",
432-
scalacOptions = SbtCommunityProject.scalacOptions.filter(flag => flag != "-Ysafe-init" && flag != "-Wsafe-init"),
432+
scalacOptions = SbtCommunityProject.scalacOptions.filter(_ != "-Wsafe-init"),
433433
dependencies = List(munit, scodecBits),
434434
)
435435

@@ -503,14 +503,14 @@ object projects:
503503
project = "verify",
504504
sbtTestCommand = "verifyJVM/test",
505505
sbtDocCommand = "verifyJVM/doc",
506-
scalacOptions = SbtCommunityProject.scalacOptions.filter(flag => flag != "-Xcheck-macros") // TODO enable -Xcheck-macros
506+
scalacOptions = SbtCommunityProject.scalacOptions.filter(_ != "-Xcheck-macros") // TODO enable -Xcheck-macros
507507
)
508508

509509
lazy val discipline = SbtCommunityProject(
510510
project = "discipline",
511511
sbtTestCommand = "coreJVM/test;coreJS/test",
512512
sbtPublishCommand = "set every credentials := Nil;coreJVM/publishLocal;coreJS/publishLocal",
513-
scalacOptions = SbtCommunityProject.scalacOptions.filter(flag => flag != "-Ysafe-init" && flag != "-Wsafe-init"),
513+
scalacOptions = SbtCommunityProject.scalacOptions.filter(_ != "-Wsafe-init"),
514514
dependencies = List(scalacheck)
515515
)
516516

@@ -540,7 +540,7 @@ object projects:
540540
sbtTestCommand = "set Global/scalaJSStage := FastOptStage;rootJVM/test;rootJS/test",
541541
sbtPublishCommand = "rootJVM/publishLocal;rootJS/publishLocal",
542542
dependencies = List(discipline, disciplineMunit, scalacheck, simulacrumScalafixAnnotations),
543-
scalacOptions = SbtCommunityProject.scalacOptions.filter(flag => flag != "-Ysafe-init" && flag != "-Wsafe-init") // disable -Ysafe-init or -Wsafe-init, due to -Xfatal-warning
543+
scalacOptions = SbtCommunityProject.scalacOptions.filter(_ != "-Wsafe-init") // disable -Ysafe-init or -Wsafe-init, due to -Xfatal-warning
544544
)
545545

546546
lazy val catsMtl = SbtCommunityProject(
@@ -655,7 +655,7 @@ object projects:
655655
"""set actorTests/Compile/scalacOptions -= "-Xfatal-warnings"""",
656656
"akka-actor-tests/Test/compile",
657657
).mkString("; "),
658-
scalacOptions = SbtCommunityProject.scalacOptions.filter(flag => flag != "-Ysafe-init" && flag != "-Wsafe-init"),
658+
scalacOptions = SbtCommunityProject.scalacOptions.filter(_ != "-Wsafe-init"),
659659
dependencies = List(scalatest, scalatestplusJunit, scalatestplusScalacheck)
660660
)
661661

@@ -706,7 +706,7 @@ object projects:
706706
project = "fs2",
707707
sbtTestCommand = "coreJVM/test; coreJS/test", // io/test requires JDK9+
708708
sbtPublishCommand = "coreJVM/publishLocal; coreJS/publishLocal",
709-
scalacOptions = SbtCommunityProject.scalacOptions.filter(flag => flag != "-Ysafe-init" && flag != "-Wsafe-init"),
709+
scalacOptions = SbtCommunityProject.scalacOptions.filter(_ != "-Wsafe-init"),
710710
dependencies = List(cats, catsEffect3, munitCatsEffect, scalacheckEffect, scodecBits)
711711
)
712712

@@ -743,7 +743,7 @@ object projects:
743743
project = "http4s",
744744
sbtTestCommand = """set ThisBuild / tlFatalWarnings := false; rootJVM/test""",
745745
sbtPublishCommand = "publishLocal",
746-
scalacOptions = SbtCommunityProject.scalacOptions.filter(flag => flag != "-Ysafe-init" && flag != "-Wsafe-init"),
746+
scalacOptions = SbtCommunityProject.scalacOptions.filter(_ != "-Wsafe-init"),
747747
dependencies = List(cats, catsEffect3, fs2, disciplineMunit, scalacheckEffect)
748748
)
749749

compiler/src/dotty/tools/dotc/config/ScalaSettings.scala

+19-31
Original file line numberDiff line numberDiff line change
@@ -359,20 +359,8 @@ private sealed trait XSettings:
359359

360360
val XmacroSettings: Setting[List[String]] = MultiStringSetting(AdvancedSetting, "Xmacro-settings", "setting1,setting2,..settingN", "List of settings which exposed to the macros")
361361

362-
@deprecated(message = "Superseded by -Wshadow, Scheduled for removal in 3.6.0", since = "3.5.0")
363-
val Xlint: Setting[List[ChoiceWithHelp[String]]] = MultiChoiceHelpSetting(
364-
AdvancedSetting,
365-
name = "Xlint",
366-
helpArg = "advanced warning",
367-
descr = "Enable or disable specific `lint` warnings",
368-
choices = List(
369-
ChoiceWithHelp("all", ""),
370-
ChoiceWithHelp("private-shadow", "Warn if a private field or class parameter shadows a superclass field"),
371-
ChoiceWithHelp("type-parameter-shadow", "Warn when a type parameter shadows a type already in the scope"),
372-
),
373-
default = Nil,
374-
deprecation = Deprecation.renamed("-Wshadow"),
375-
)
362+
@deprecated(message = "Superseded by -Wshadow, Scheduled for removal", since = "3.5.0")
363+
val Xlint: Setting[_] = BooleanSetting(AdvancedSetting, "Xlint", "Enable or disable specific warnings", deprecation = Some(Deprecation("Use -Wshadow to enable shadowing lints. Scheduled for removal.")))
376364

377365
end XSettings
378366

@@ -466,41 +454,41 @@ private sealed trait YSettings:
466454
val YinstrumentDefs: Setting[Boolean] = BooleanSetting(ForkSetting, "Yinstrument-defs", "Add instrumentation code that counts method calls; needs -Yinstrument to be set, too.")
467455

468456
// Deprecated: lifted from -Y to -X
469-
@deprecated(message = "Lifted to -X, Scheduled for removal in 3.6.0", since = "3.5.0")
457+
@deprecated(message = "Lifted to -X, Scheduled for removal.", since = "3.5.0")
470458
val YtermConflict: Setting[String] = ChoiceSetting(ForkSetting, "Yresolve-term-conflict", "strategy", "Resolve term conflicts", List("package", "object", "error"), "error", deprecation = Deprecation.renamed("-Xresolve-term-conflict"))
471-
@deprecated(message = "Lifted to -X, Scheduled for removal in 3.6.0", since = "3.5.0")
459+
@deprecated(message = "Lifted to -X, Scheduled for removal.", since = "3.5.0")
472460
val YnoGenericSig: Setting[Boolean] = BooleanSetting(ForkSetting, "Yno-generic-signatures", "Suppress generation of generic signatures for Java.", deprecation = Deprecation.renamed("-Xno-generic-signatures"))
473-
@deprecated(message = "Lifted to -X, Scheduled for removal in 3.6.0", since = "3.5.0")
461+
@deprecated(message = "Lifted to -X, Scheduled for removal.", since = "3.5.0")
474462
val Ydumpclasses: Setting[String] = StringSetting(ForkSetting, "Ydump-classes", "dir", "Dump the generated bytecode to .class files (useful for reflective compilation that utilizes in-memory classloaders).", default = "", deprecation = Deprecation.renamed("-Xdump-classes"))
475-
@deprecated(message = "Lifted to -X, Scheduled for removal in 3.6.0", since = "3.5.0")
463+
@deprecated(message = "Lifted to -X, Scheduled for removal.", since = "3.5.0")
476464
val YjarCompressionLevel: Setting[Int] = IntChoiceSetting(ForkSetting, "Yjar-compression-level", "compression level to use when writing jar files", Deflater.DEFAULT_COMPRESSION to Deflater.BEST_COMPRESSION, Deflater.DEFAULT_COMPRESSION, deprecation = Deprecation.renamed("-Xjar-compression-level"))
477-
@deprecated(message = "Lifted to -X, Scheduled for removal in 3.6.0", since = "3.5.0")
465+
@deprecated(message = "Lifted to -X, Scheduled for removal.", since = "3.5.0")
478466
val YkindProjector: Setting[String] = ChoiceSetting(ForkSetting, "Ykind-projector", "[underscores, enable, disable]", "Allow `*` as type lambda placeholder to be compatible with kind projector. When invoked as -Ykind-projector:underscores will repurpose `_` to be a type parameter placeholder, this will disable usage of underscore as a wildcard.", List("disable", "", "underscores"), "disable", legacyArgs = true, deprecation = Deprecation.renamed("-Xkind-projector"))
479-
@deprecated(message = "Lifted to -X, Scheduled for removal in 3.6.0", since = "3.5.0")
467+
@deprecated(message = "Lifted to -X, Scheduled for removal.", since = "3.5.0")
480468
val YdropComments: Setting[Boolean] = BooleanSetting(ForkSetting, "Ydrop-docs", "Drop documentation when scanning source files.", aliases = List("-Ydrop-comments"), deprecation = Deprecation.renamed("-Xdrop-docs"))
481-
@deprecated(message = "Lifted to -X, Scheduled for removal in 3.6.0", since = "3.5.0")
469+
@deprecated(message = "Lifted to -X, Scheduled for removal.", since = "3.5.0")
482470
val YcookComments: Setting[Boolean] = BooleanSetting(ForkSetting, "Ycook-docs", "Cook the documentation (type check `@usecase`, etc.)", aliases = List("-Ycook-comments"), deprecation = Deprecation.renamed("-Xcook-docs"))
483-
@deprecated(message = "Lifted to -X, Scheduled for removal in 3.6.0", since = "3.5.0")
471+
@deprecated(message = "Lifted to -X, Scheduled for removal.", since = "3.5.0")
484472
val YreadComments: Setting[Boolean] = BooleanSetting(ForkSetting, "Yread-docs", "Read documentation from tasty.", deprecation = Deprecation.renamed("-Xread-docs"))
485-
@deprecated(message = "Lifted to -X, Scheduled for removal in 3.6.0", since = "3.5.0")
473+
@deprecated(message = "Lifted to -X, Scheduled for removal.", since = "3.5.0")
486474
val YnoDecodeStacktraces: Setting[Boolean] = BooleanSetting(ForkSetting, "Yno-decode-stacktraces", "Show raw StackOverflow stacktraces, instead of decoding them into triggering operations.", deprecation = Deprecation.renamed("-Xno-decode-stacktraces"))
487-
@deprecated(message = "Lifted to -X, Scheduled for removal in 3.6.0", since = "3.5.0")
475+
@deprecated(message = "Lifted to -X, Scheduled for removal.", since = "3.5.0")
488476
val YnoEnrichErrorMessages: Setting[Boolean] = BooleanSetting(ForkSetting, "Yno-enrich-error-messages", "Show raw error messages, instead of enriching them with contextual information.", deprecation = Deprecation.renamed("-Xno-enrich-error-messages"))
489-
@deprecated(message = "Lifted to -X, Scheduled for removal in 3.6.0", since = "3.5.0")
477+
@deprecated(message = "Lifted to -X, Scheduled for removal.", since = "3.5.0")
490478
val YdebugMacros: Setting[Boolean] = BooleanSetting(ForkSetting, "Ydebug-macros", "Show debug info when quote pattern match fails", deprecation = Deprecation.renamed("-Xdebug-macros"))
491479

492-
// @deprecated(message = "Lifted to -X, Scheduled for removal in 3.8.0", since = "3.7.0")
480+
// @deprecated(message = "Lifted to -X, Scheduled for removal.", since = "3.7.0")
493481
// val YjavaTasty: Setting[Boolean] = BooleanSetting(ForkSetting, "Yjava-tasty", "Pickler phase should compute TASTy for .java defined symbols for use by build tools", aliases = List("-Ypickle-java"), preferPrevious = true, deprecation = Deprecation.lifted("-Xjava-tasty"))
494-
// @deprecated(message = "Lifted to -X, Scheduled for removal in 3.8.0", since = "3.7.0")
482+
// @deprecated(message = "Lifted to -X, Scheduled for removal.", since = "3.7.0")
495483
// val YearlyTastyOutput: Setting[AbstractFile] = OutputSetting(ForkSetting, "Yearly-tasty-output", "directory|jar", "Destination to write generated .tasty files to for use in pipelined compilation.", NoAbstractFile, aliases = List("-Ypickle-write"), preferPrevious = true, deprecation = Deprecation.lifted("-Xearly-tasty-output"))
496-
// @deprecated(message = "Lifted to -X, Scheduled for removal in 3.8.0", since = "3.7.0")
484+
// @deprecated(message = "Lifted to -X, Scheduled for removal.", since = "3.7.0")
497485
// val YallowOutlineFromTasty: Setting[Boolean] = BooleanSetting(ForkSetting, "Yallow-outline-from-tasty", "Allow outline TASTy to be loaded with the -from-tasty option.", deprecation = Deprecation.lifted("-Xallow-outline-from-tasty"))
498486

499487
// Deprecated: lifted from -Y to -W
500-
@deprecated(message = "Lifted to -W, Scheduled for removal in 3.6.0", since = "3.5.0")
488+
@deprecated(message = "Lifted to -W, Scheduled for removal.", since = "3.5.0")
501489
val YcheckInit: Setting[Boolean] = BooleanSetting(ForkSetting, "Ysafe-init", "Ensure safe initialization of objects.", deprecation = Deprecation.renamed("-Wsafe-init"))
502490

503491
// Deprecated: Scheduled for removal
504-
@deprecated(message = "Scheduled for removal in 3.6.0", since = "3.5.0")
505-
val YoutputOnlyTasty: Setting[Boolean] = BooleanSetting(ForkSetting, "Youtput-only-tasty", "Used to only generate the TASTy file without the classfiles", deprecation = Deprecation.removed("3.6.0"))
492+
@deprecated(message = "Scheduled for removal.", since = "3.5.0")
493+
val YoutputOnlyTasty: Setting[Boolean] = BooleanSetting(ForkSetting, "Youtput-only-tasty", "Used to only generate the TASTy file without the classfiles", deprecation = Deprecation.removed())
506494
end YSettings

compiler/src/dotty/tools/dotc/config/Settings.scala

+7-3
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,9 @@ object Settings:
134134
if argStringValue.isEmpty then state.deprecated(deprecatedMsg, List(replacedBy))
135135
else state.deprecated(deprecatedMsg, List(s"$replacedBy:$argStringValue"))
136136

137-
case Some(Deprecation(msg, _)) => state.deprecated(msg)
137+
case Some(Deprecation(msg, _)) =>
138+
state.deprecated(s"Option $name is deprecated: $msg")
139+
138140
case None =>
139141
val value = getValue
140142
var dangers = warnings
@@ -263,14 +265,16 @@ object Settings:
263265
* @param msg deprecation message that will be displayed in following format: s"Option $name is deprecated: $msg"
264266
* @param replacedBy option that is substituting current option
265267
*/
266-
case class Deprecation private(
268+
case class Deprecation(
267269
msg: String,
268270
replacedBy: Option[String] = None,
269271
)
270272

271273
object Deprecation:
272274
def renamed(replacement: String) = Some(Deprecation(s"Use $replacement instead.", Some(replacement)))
273-
def removed(removedVersion: String) = Some(Deprecation(s"Scheduled for removal in s$removedVersion", None))
275+
def removed(removedVersion: Option[String] = None) =
276+
val msg = removedVersion.map(" in " + _).getOrElse(".")
277+
Some(Deprecation(s"Scheduled for removal$msg", None))
274278

275279
object Setting:
276280
extension [T](setting: Setting[T])

compiler/test/dotty/tools/dotc/config/ScalaSettingsTests.scala

+2-2
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ class ScalaSettingsTests:
112112
// createTestCase(settings.YearlyTastyOutput , settings.XearlyTastyOutput, ":./"),
113113
// createTestCase(settings.YallowOutlineFromTasty, settings.XallowOutlineFromTasty),
114114
createTestCase(settings.YcheckInit , settings.WcheckInit),
115-
createTestCase(settings.Xlint , settings.Wshadow, ":all"),
115+
// createTestCase(settings.Xlint , settings.Wshadow, ":all"), // this setting is not going to be mapped to replacement. Read more in the commit message
116116
).map: (deprecatedArgument, newSetting) =>
117117
val args = List(deprecatedArgument)
118118
val argSummary = ArgsSummary(settings.defaultState, args, errors = Nil, warnings = Nil)
@@ -171,7 +171,7 @@ class ScalaSettingsTests:
171171
// createTestCase(settings.YearlyTastyOutput , settings.XearlyTastyOutput, ":./"),
172172
// createTestCase(settings.YallowOutlineFromTasty, settings.XallowOutlineFromTasty),
173173
createTestCase(settings.YcheckInit , settings.WcheckInit),
174-
createTestCase(settings.Xlint , settings.Wshadow, ":all"),
174+
// createTestCase(settings.Xlint , settings.Wshadow, ":all"), // this setting is not going to be mapped to replacement. Read more in the commit message
175175
).flatten.map: (deprecatedArgument, newSetting) =>
176176
val args = List(deprecatedArgument)
177177
val argSummary = ArgsSummary(settings.defaultState, args, errors = Nil, warnings = Nil)

0 commit comments

Comments
 (0)