Skip to content

Commit 2dc83c8

Browse files
committed
Revert old behaviour of -Xlint
1 parent 154b34f commit 2dc83c8

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ private sealed trait XSettings:
360360
val XmacroSettings: Setting[List[String]] = MultiStringSetting(AdvancedSetting, "Xmacro-settings", "setting1,setting2,..settingN", "List of settings which exposed to the macros")
361361

362362
// Deprecated
363-
val Xlint: Setting[List[ChoiceWithHelp[String]]] = MultiChoiceHelpSetting(
363+
val Xlint: Setting[List[ChoiceWithHelp[String]]] = UncompleteMultiChoiceHelpSetting(
364364
AdvancedSetting,
365365
name = "Xlint",
366366
helpArg = "advanced warning",
@@ -371,7 +371,7 @@ private sealed trait XSettings:
371371
ChoiceWithHelp("type-parameter-shadow", "Warn when a type parameter shadows a type already in the scope"),
372372
),
373373
default = Nil,
374-
deprecation = Some(Deprecation("Use -Wshadow to enable shadowing lints.", "-Wshadow"))
374+
deprecation = Some(Deprecation("Use -Wshadow to enable shadowing lints.", "-Wshadow")),
375375
)
376376

377377
end XSettings

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

Lines changed: 3 additions & 0 deletions
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)