Skip to content

Commit 5e05468

Browse files
committed
Remove -Ywarn-value-discard alias
1 parent ef34c69 commit 5e05468

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ private sealed trait WarningSettings:
157157
self: SettingGroup =>
158158
val Whelp: Setting[Boolean] = BooleanSetting("-W", "Print a synopsis of warning options.")
159159
val XfatalWarnings: Setting[Boolean] = BooleanSetting("-Werror", "Fail the compilation if there are any warnings.", aliases = List("-Xfatal-warnings"))
160-
val YwarnValueDiscard: Setting[Boolean] = BooleanSetting("-Wvalue-discard", "Warn when non-Unit expression results are unused.", aliases = List("-Ywarn-value-discard"))
160+
val WvalueDiscard: Setting[Boolean] = BooleanSetting("-Wvalue-discard", "Warn when non-Unit expression results are unused.")
161161

162162
val Wunused: Setting[List[String]] = MultiChoiceSetting(
163163
name = "-Wunused",

compiler/src/dotty/tools/dotc/typer/Typer.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3928,7 +3928,7 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
39283928
// so will take the code path that decides on inlining
39293929
val tree1 = adapt(tree, WildcardType, locked)
39303930
checkStatementPurity(tree1)(tree, ctx.owner)
3931-
if (!ctx.isAfterTyper && !tree.isInstanceOf[Inlined] && ctx.settings.YwarnValueDiscard.value) {
3931+
if (!ctx.isAfterTyper && !tree.isInstanceOf[Inlined] && ctx.settings.WvalueDiscard.value) {
39323932
report.warning(ValueDiscarding(tree.tpe), tree.srcPos)
39333933
}
39343934
return tpd.Block(tree1 :: Nil, Literal(Constant(())))

0 commit comments

Comments
 (0)