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

-Xlint:cloneable ignores -Wconf:any settings #12985

Open
coreywoodfield opened this issue Apr 11, 2024 · 3 comments · May be fixed by scala/scala#10756
Open

-Xlint:cloneable ignores -Wconf:any settings #12985

coreywoodfield opened this issue Apr 11, 2024 · 3 comments · May be fixed by scala/scala#10756
Labels

Comments

@coreywoodfield
Copy link

Reproduction steps

Scala version: 2.13.13

object Bar extends Cloneable {
  def f: Unit = {}
}
$ scalac Test.scala -Xlint -Wconf:any:error
Test.scala:1: warning: object Bar should not extend Cloneable.
object Bar extends Cloneable {
       ^
Test.scala:2: error: side-effecting nullary methods are discouraged: suggest defining as `def f()` instead [quickfixable]
Applicable -Wconf / @nowarn filters for this fatal warning: msg=<part of the message>, cat=lint-nullary-unit, site=Bar
  def f: Unit = {}
      ^
1 warning
1 error
$ scalac Test.scala -Xlint -Wconf:any:silent
Test.scala:1: warning: object Bar should not extend Cloneable.
object Bar extends Cloneable {
       ^
1 warning

Problem

-Xlint:cloneable level isn't changed by -Wconf:any settings, whereas -Xlint:nullary-unit and every other lint setting I've tested is

@som-snytt
Copy link

I'm aware that -Wconf originally configured configurable warnings, which were warnings normally collected for a "summary" report. If -Wconf can configure any warning, then all warnings must be treated the same way, including warnings that don't have a summary report.

@lrytz
Copy link
Member

lrytz commented Apr 15, 2024

@som-snytt som-snytt linked a pull request Apr 15, 2024 that will close this issue
@som-snytt
Copy link

... should use refchecksWarning ...

I admit I avoid the overloaded runReporting.warning because of decision fatigue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants