Skip to content

Commit 35a00f5

Browse files
committed
Revert old behaviour of -Xlint
1 parent 87d9cab commit 35a00f5

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ private sealed trait XSettings:
356356
val XmacroSettings: Setting[List[String]] = MultiStringSetting(AdvancedSetting, "Xmacro-settings", "setting1,setting2,..settingN", "List of settings which exposed to the macros")
357357

358358
// Deprecated
359-
val Xlint: Setting[List[ChoiceWithHelp[String]]] = MultiChoiceHelpSetting(
359+
val Xlint: Setting[List[ChoiceWithHelp[String]]] = UncompleteMultiChoiceHelpSetting(
360360
AdvancedSetting,
361361
name = "Xlint",
362362
helpArg = "advanced warning",
@@ -367,7 +367,7 @@ private sealed trait XSettings:
367367
ChoiceWithHelp("type-parameter-shadow", "Warn when a type parameter shadows a type already in the scope"),
368368
),
369369
default = Nil,
370-
deprecation = Some(Deprecation("Use -Wshadow to enable shadowing lints.", "-Wshadow"))
370+
deprecation = Some(Deprecation("Use -Wshadow to enable shadowing lints.", "-Wshadow")),
371371
)
372372

373373
end XSettings

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

+3
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,9 @@ object Settings:
375375
def MultiChoiceHelpSetting(category: SettingCategory, name: String, helpArg: String, descr: String, choices: List[ChoiceWithHelp[String]], default: List[ChoiceWithHelp[String]], aliases: List[String] = Nil, deprecation: Option[Deprecation] = None): Setting[List[ChoiceWithHelp[String]]] =
376376
publish(Setting(category, prependName(name), descr, default, helpArg, Some(choices), aliases = aliases, deprecation = deprecation))
377377

378+
def UncompleteMultiChoiceHelpSetting(category: SettingCategory, name: String, helpArg: String, descr: String, choices: List[ChoiceWithHelp[String]], default: List[ChoiceWithHelp[String]], aliases: List[String] = Nil, deprecation: Option[Deprecation] = None): Setting[List[ChoiceWithHelp[String]]] =
379+
publish(Setting(category, prependName(name), descr, default, helpArg, Some(choices), aliases = aliases, deprecation = deprecation, ignoreInvalidArgs = true))
380+
378381
def IntSetting(category: SettingCategory, name: String, descr: String, default: Int, aliases: List[String] = Nil, deprecation: Option[Deprecation] = None): Setting[Int] =
379382
publish(Setting(category, prependName(name), descr, default, aliases = aliases, deprecation = deprecation))
380383

0 commit comments

Comments
 (0)