Skip to content

Commit

Permalink
Rename options -Wliteral-args -Wboolean-literal
Browse files Browse the repository at this point in the history
  • Loading branch information
som-snytt committed Mar 12, 2024
1 parent b89ad0c commit 6bbe4ee
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/compiler/scala/tools/nsc/settings/Warnings.scala
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,8 @@ trait Warnings {
val warnValueDiscard = BooleanSetting("-Wvalue-discard", "Warn when non-Unit expression results are unused.") withAbbreviation "-Ywarn-value-discard"
val warnNumericWiden = BooleanSetting("-Wnumeric-widen", "Warn when numerics are widened.") withAbbreviation "-Ywarn-numeric-widen"
val warnOctalLiteral = BooleanSetting("-Woctal-literal", "Warn on obsolete octal syntax.") withAbbreviation "-Ywarn-octal-literal"
val warnNamedLiteral = BooleanSetting("-Wnamed-literal", "Warn when unnamed literal arguments may be swapped, unless parameter has @deprecatedName.")
val warnNamedBoolean = BooleanSetting("-Wnamed-boolean", "Boolean literal arguments should be named.").enabling(warnNamedLiteral :: Nil)
val warnNamedLiteral = BooleanSetting("-Wliteral-args", "Warn when positional literal arguments should be named, unless parameter has @deprecatedName.")
val warnNamedBoolean = BooleanSetting("-Wboolean-literal", "Boolean literal arguments should be named.").enabling(warnNamedLiteral :: Nil)

object PerformanceWarnings extends MultiChoiceEnumeration {
val Captured = Choice("captured", "Modification of var in closure causes boxing.")
Expand Down
2 changes: 1 addition & 1 deletion test/files/neg/named-booleans-relaxed.scala
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//> using options -Werror -Wnamed-literal
//> using options -Werror -Wliteral-args

class C {
def f(n: Int = 42, x: Boolean, y: Boolean) = if (x && y) n else 0
Expand Down
2 changes: 1 addition & 1 deletion test/files/neg/named-booleans.scala
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//> using options -Werror -Wnamed-boolean
//> using options -Werror -Wboolean-literal

class C {
def f(n: Int = 42, x: Boolean, y: Boolean) = if (x && y) n else 0
Expand Down
2 changes: 1 addition & 1 deletion test/junit/scala/tools/nsc/QuickfixTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,6 @@ class QuickfixTest extends BytecodeTesting {
| def test = f(hasState = true, isMutable = false)
|}
|"""
testQuickfix(a, b, "-Wnamed-literal -quickfix:any")
testQuickfix(a, b, "-Wliteral-args -quickfix:any")
}
}

0 comments on commit 6bbe4ee

Please sign in to comment.