diff options
author | Paul Phillips <paulp@improving.org> | 2011-09-05 00:11:29 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2011-09-05 00:11:29 +0000 |
commit | fa2deeb4304d149c4870cfb013e7790d6fe00d86 (patch) | |
tree | bf0bbd999592d412811f4647f1e94ad3c1165191 /src/library | |
parent | 6817244d64fca81810e6e45f8a4ea53e9e6d76c2 (diff) | |
download | scala-fa2deeb4304d149c4870cfb013e7790d6fe00d86.tar.gz scala-fa2deeb4304d149c4870cfb013e7790d6fe00d86.tar.bz2 scala-fa2deeb4304d149c4870cfb013e7790d6fe00d86.zip |
Offer warning when demonstrably non-side-effect...
Offer warning when demonstrably non-side-effecting expressions appear in
statement position, which should be unintentional by definition. Threw
in removal of six places with useless discarded expressions which the
warning informed me about. No review.
Diffstat (limited to 'src/library')
-rw-r--r-- | src/library/scala/collection/JavaConversions.scala | 25 | ||||
-rw-r--r-- | src/library/scala/xml/dtd/ContentModel.scala | 1 |
2 files changed, 13 insertions, 13 deletions
diff --git a/src/library/scala/collection/JavaConversions.scala b/src/library/scala/collection/JavaConversions.scala index f67fd47708..fad990e140 100644 --- a/src/library/scala/collection/JavaConversions.scala +++ b/src/library/scala/collection/JavaConversions.scala @@ -678,18 +678,19 @@ object JavaConversions { } } - def remove() = prev match { - case Some(k) => - underlying match { - case mm: mutable.Map[A, _] => - val v = mm remove k.asInstanceOf[A] - prev = None - v - case _ => - throw new UnsupportedOperationException("remove") - } - case _ => - throw new IllegalStateException("next must be called at least once before remove") + def remove() { + prev match { + case Some(k) => + underlying match { + case mm: mutable.Map[A, _] => + mm remove k.asInstanceOf[A] + prev = None + case _ => + throw new UnsupportedOperationException("remove") + } + case _ => + throw new IllegalStateException("next must be called at least once before remove") + } } } } diff --git a/src/library/scala/xml/dtd/ContentModel.scala b/src/library/scala/xml/dtd/ContentModel.scala index cae2236346..1e9a3a4b58 100644 --- a/src/library/scala/xml/dtd/ContentModel.scala +++ b/src/library/scala/xml/dtd/ContentModel.scala @@ -52,7 +52,6 @@ object ContentModel extends WordExp { sb append sep buildString(z, sb) } - sb } def buildString(c: ContentModel, sb: StringBuilder): StringBuilder = c match { |