Scala 2.13.9 with -Wnonunit-statement and xml literals result in false positives
Reproduction steps
Scala version: 2.13.9
class C {
val xml = <xml><elem></elem></xml>
def some = xml
}
Problem
Warning produced on line 2:
unused value of type scala.xml.NodeBuffer (add : Unit to discard silently)
Expected: the code compiles without warning.
good catch, thanks! @som-snytt will likely want to take a look
Thanks, I'll take a look. My umbrella ticket is https://github.com/scala/bug/issues/12653, but I'll follow up here.
I would not have thought to check XML -- in case there is another ticket for "things we never compile when we compile the compiler."
@som-snytt I'm putting this on Backlog, but feel free to try to fix it for 2.13.11 anyway, if you're so inclined :-)