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

Fix incorrect version range for -Wunused:nowarn, add the backported option with the correct name #63

Merged
merged 1 commit into from
Jul 18, 2023
Merged
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
17 changes: 14 additions & 3 deletions lib/src/main/scala/org/typelevel/scalacoptions/ScalacOptions.scala
Original file line number Diff line number Diff line change
Expand Up @@ -606,6 +606,16 @@ private[scalacoptions] trait ScalacOptions {
version => version.isBetween(V2_12_0, V2_13_0)
)

/** Warn if a @nowarn annotation did not suppress at least one warning.
*
* Added in 2.13.2 as -Wunused:nowarn, backported to 2.12.13 as -Ywarn-unused:nowarn.
*/
val privateWarnUnusedNoWarn =
privateWarnUnusedOption(
"nowarn",
version => version.isBetween(V2_12_13, V2_13_0)
)

/** Private unused warning options (-Ywarn-unused:)
*/
val privateWarnUnusedOptions: Set[ScalacOption] = ListSet(
Expand All @@ -614,7 +624,8 @@ private[scalacoptions] trait ScalacOptions {
privateWarnUnusedLocals,
privateWarnUnusedParams,
privateWarnUnusedPatVars,
privateWarnUnusedPrivates
privateWarnUnusedPrivates,
privateWarnUnusedNoWarn
)

/** Private warning options (-Ywarn)
Expand Down Expand Up @@ -695,12 +706,12 @@ private[scalacoptions] trait ScalacOptions {

/** Warn if a @nowarn annotation did not suppress at least one warning.
*
* Added in 2.13.2, backported to 2.12.13.
* Added in 2.13.2, backported to 2.12.13 as -Ywarn-unused:nowarn.
*/
val warnUnusedNoWarn =
warnUnusedOption(
"nowarn",
version => version.isBetween(V2_12_13, V2_13_0) || version.isBetween(V2_13_2, V3_0_0)
version => version.isBetween(V2_13_2, V3_0_0)
)

/** Warn if an implicit parameter is unused.
Expand Down