summaryrefslogtreecommitdiff
path: root/test/files/neg/stmt-expr-discard.check
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2011-09-05 00:11:29 +0000
committerPaul Phillips <paulp@improving.org>2011-09-05 00:11:29 +0000
commitfa2deeb4304d149c4870cfb013e7790d6fe00d86 (patch)
treebf0bbd999592d412811f4647f1e94ad3c1165191 /test/files/neg/stmt-expr-discard.check
parent6817244d64fca81810e6e45f8a4ea53e9e6d76c2 (diff)
downloadscala-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 'test/files/neg/stmt-expr-discard.check')
-rw-r--r--test/files/neg/stmt-expr-discard.check7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/files/neg/stmt-expr-discard.check b/test/files/neg/stmt-expr-discard.check
new file mode 100644
index 0000000000..2d6420a61d
--- /dev/null
+++ b/test/files/neg/stmt-expr-discard.check
@@ -0,0 +1,7 @@
+stmt-expr-discard.scala:3: error: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+ + 2
+ ^
+stmt-expr-discard.scala:4: error: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+ - 4
+ ^
+two errors found