Closed
Description
Compiler version
3.3.1-RC1
Minimized code
<foo>bar</foo>: @annotation.nowarn("msg=unused value")
Output
-- [E176] Potential Issue Error: test.scala:1:5 --------------
1 | <foo>bar</foo>: @annotation.nowarn("msg=unused value")
| ^
| unused value of type xml.NodeBuffer
Expectation
The nowarn
annotation should silence the warning. I've also tried using a -Wconf
compiler option but still no luck.
I said "some" in the title because the issue doesn't happen for all non-Unit statements. I initially came across it with XML-literals in my code and found that it doesn't happen for other simple statements, e.g. this works properly
scala.util.Try(1): @annotation.nowarn("msg=unused value")