-
Notifications
You must be signed in to change notification settings - Fork 22
Closed
scala/scala
#9032Milestone
Description
reproduction steps
Scala 2.13.2
Given a warning like:
$ scala -e 'def f: Unit = 1'
/tmp/scalacmd15643647702672000142.scala:1: warning: a pure expression does nothing in statement position
def f: Unit = 1
^
Using @nowarn("cat=other-pure-statement") will suppress it:
$ scala -e 'import scala.annotation.nowarn; @nowarn("cat=other-pure-statement") def f: Unit = 1'
problem
The problem is that it looks like only one filter need apply:
$ scala -e 'import scala.annotation.nowarn; @nowarn("cat=other-pure-statement&msg=bob") def f: Unit = 1'
$ scala -e 'import scala.annotation.nowarn; @nowarn("msg=bob&cat=other-pure-statement") def f: Unit = 1'
Compare to -Wconf where all filters must apply:
$ scala -e 'def f: Unit = 1' '-Wconf:cat=other-pure-statement:silent'
$ scala -e 'def f: Unit = 1' '-Wconf:cat=other-pure-statement&msg=bob:silent'
/tmp/scalacmd13462434343326996307.scala:1: warning: a pure expression does nothing in statement position
def f: Unit = 1
^
$ scala -e 'def f: Unit = 1' '-Wconf:msg=bob&cat=other-pure-statement:silent'
/tmp/scalacmd13326564175167716430.scala:1: warning: a pure expression does nothing in statement position
def f: Unit = 1
^
Reactions are currently unavailable