Skip to content

Commit

Permalink
Revert old behaviour of -Xlint
Browse files Browse the repository at this point in the history
  • Loading branch information
rochala committed Apr 16, 2024
1 parent 87d9cab commit 35a00f5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions compiler/src/dotty/tools/dotc/config/ScalaSettings.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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
Expand Down
3 changes: 3 additions & 0 deletions compiler/src/dotty/tools/dotc/config/Settings.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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))

Expand Down

0 comments on commit 35a00f5

Please sign in to comment.