From 35a00f545794d2f6361e53e0c4b2c60c335a7844 Mon Sep 17 00:00:00 2001 From: rochala Date: Tue, 16 Apr 2024 20:08:02 +0200 Subject: [PATCH] Revert old behaviour of -Xlint --- compiler/src/dotty/tools/dotc/config/ScalaSettings.scala | 4 ++-- compiler/src/dotty/tools/dotc/config/Settings.scala | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/compiler/src/dotty/tools/dotc/config/ScalaSettings.scala b/compiler/src/dotty/tools/dotc/config/ScalaSettings.scala index 3c14c012bb48..df041680b4c7 100644 --- a/compiler/src/dotty/tools/dotc/config/ScalaSettings.scala +++ b/compiler/src/dotty/tools/dotc/config/ScalaSettings.scala @@ -356,7 +356,7 @@ private sealed trait XSettings: val XmacroSettings: Setting[List[String]] = MultiStringSetting(AdvancedSetting, "Xmacro-settings", "setting1,setting2,..settingN", "List of settings which exposed to the macros") // Deprecated - val Xlint: Setting[List[ChoiceWithHelp[String]]] = MultiChoiceHelpSetting( + val Xlint: Setting[List[ChoiceWithHelp[String]]] = UncompleteMultiChoiceHelpSetting( AdvancedSetting, name = "Xlint", helpArg = "advanced warning", @@ -367,7 +367,7 @@ private sealed trait XSettings: ChoiceWithHelp("type-parameter-shadow", "Warn when a type parameter shadows a type already in the scope"), ), default = Nil, - deprecation = Some(Deprecation("Use -Wshadow to enable shadowing lints.", "-Wshadow")) + deprecation = Some(Deprecation("Use -Wshadow to enable shadowing lints.", "-Wshadow")), ) end XSettings diff --git a/compiler/src/dotty/tools/dotc/config/Settings.scala b/compiler/src/dotty/tools/dotc/config/Settings.scala index 80e8c839cef1..eab74276b1ca 100644 --- a/compiler/src/dotty/tools/dotc/config/Settings.scala +++ b/compiler/src/dotty/tools/dotc/config/Settings.scala @@ -375,6 +375,9 @@ object Settings: 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]]] = publish(Setting(category, prependName(name), descr, default, helpArg, Some(choices), aliases = aliases, deprecation = deprecation)) + 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]]] = + publish(Setting(category, prependName(name), descr, default, helpArg, Some(choices), aliases = aliases, deprecation = deprecation, ignoreInvalidArgs = true)) + def IntSetting(category: SettingCategory, name: String, descr: String, default: Int, aliases: List[String] = Nil, deprecation: Option[Deprecation] = None): Setting[Int] = publish(Setting(category, prependName(name), descr, default, aliases = aliases, deprecation = deprecation))