blob: c77a63cb1a47eee1c222c6cb9c2c8aec6e776a1a (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
trait ValueDiscard[@specialized U] {
def u: U
}
/* Was:
scalac-hash v2.11.5 -Ywarn-value-discard test/files/pos/t9020.scala
test/files/pos/t9020.scala:2: warning: discarded non-Unit value
def u: U
^
one warning found
*/
trait DiscardThis {
import collection.mutable.ListBuffer
val b = ListBuffer.empty[String]
def add(s: String): Unit = b += s
}
|