Closed
Description
If I am using XML literals, then I am seeing compile warnings starting with Scala version 2.13.9. I am using the sbt-tpolecat plugin so these are actually compile errors for me.
Example:
import scala.xml.Elem
case class ToDoItem(name: String) {
def toXml: Elem = {
<to-do-item>
<name>{name}</name>
</to-do-item>
}
}
Compile errors:
[error] ToDoItem.scala:5:5: unused value of type scala.xml.NodeBuffer (add `: Unit` to discard silently)
[error] <to-do-item>
[error] ^
[error] /ToDoItem.scala:6:7: unused value of type scala.xml.NodeBuffer (add `: Unit` to discard silently)
[error] <name>{name}</name>
Is this a bug or are the new unused warnings incompatible with XML literals? What do you recommend? Thank you.
Metadata
Metadata
Assignees
Labels
No labels