Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add -Wnonunit-statement #115

Merged
merged 1 commit into from
Sep 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ object ScalaVersion {
val V2_13_4 = ScalaVersion(2, 13, 4)
val V2_13_5 = ScalaVersion(2, 13, 5)
val V2_13_6 = ScalaVersion(2, 13, 6)
val V2_13_9 = ScalaVersion(2, 13, 9)
val V3_0_0 = ScalaVersion(3, 0, 0)
val V3_1_0 = ScalaVersion(3, 1, 0)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -566,6 +566,11 @@ private[davidgregory084] trait ScalacOptions {
val warnValueDiscard =
warnOption("value-discard", version => version.isBetween(V2_13_0, V3_0_0))

/** Warn when and expression is ignored because it is followed by another expression.
*/
val warnNonUnitStatement =
warnOption("nonunit-statement", version => version.isBetween(V2_13_9, V3_0_0))

/** Fail the compilation if there are any warnings.
*/
val warnError =
Expand Down Expand Up @@ -637,7 +642,8 @@ private[davidgregory084] trait ScalacOptions {
warnDeadCode,
warnExtraImplicit,
warnNumericWiden,
warnValueDiscard
warnValueDiscard,
warnNonUnitStatement
) ++ warnUnusedOptions

/** Options which fail the compilation if there are any warnings.
Expand Down