summaryrefslogtreecommitdiff
path: root/test/files/pos/t9020.scala
diff options
context:
space:
mode:
authorSom Snytt <som.snytt@gmail.com>2016-09-10 15:17:49 -0700
committerSom Snytt <som.snytt@gmail.com>2016-09-10 15:17:49 -0700
commit94518ce0be2ffdb06d1d3f81279fdc05fa568c0b (patch)
tree4307f49d1d098ed34460f8e648837cecea19f2c2 /test/files/pos/t9020.scala
parent05016d9035ab9b1c866bd9f12fdd0491f1ea0cbb (diff)
downloadscala-94518ce0be2ffdb06d1d3f81279fdc05fa568c0b.tar.gz
scala-94518ce0be2ffdb06d1d3f81279fdc05fa568c0b.tar.bz2
scala-94518ce0be2ffdb06d1d3f81279fdc05fa568c0b.zip
No warn when discarding r.f(): r.type
The paradigm is `def add(x: X): Unit = listBuffer += x`. The value that is discarded is not new information. Also cleans up the recent tweaks to help messaging. Adds newlines in case they ask for multiple helps.
Diffstat (limited to 'test/files/pos/t9020.scala')
-rw-r--r--test/files/pos/t9020.scala6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/files/pos/t9020.scala b/test/files/pos/t9020.scala
index 16e31e2572..c77a63cb1a 100644
--- a/test/files/pos/t9020.scala
+++ b/test/files/pos/t9020.scala
@@ -8,3 +8,9 @@ test/files/pos/t9020.scala:2: warning: discarded non-Unit value
^
one warning found
*/
+
+trait DiscardThis {
+ import collection.mutable.ListBuffer
+ val b = ListBuffer.empty[String]
+ def add(s: String): Unit = b += s
+}