diff options
author | Som Snytt <som.snytt@gmail.com> | 2016-09-10 15:17:49 -0700 |
---|---|---|
committer | Som Snytt <som.snytt@gmail.com> | 2016-09-10 15:17:49 -0700 |
commit | 94518ce0be2ffdb06d1d3f81279fdc05fa568c0b (patch) | |
tree | 4307f49d1d098ed34460f8e648837cecea19f2c2 /test | |
parent | 05016d9035ab9b1c866bd9f12fdd0491f1ea0cbb (diff) | |
download | scala-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')
-rw-r--r-- | test/files/pos/t9020.scala | 6 |
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 +} |