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 /test/files/run/repl-parens.check | |
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 'test/files/run/repl-parens.check')
-rw-r--r-- | test/files/run/repl-parens.check | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/files/run/repl-parens.check b/test/files/run/repl-parens.check index 2f56e5ddd4..a3b0fd1939 100644 --- a/test/files/run/repl-parens.check +++ b/test/files/run/repl-parens.check @@ -20,6 +20,12 @@ scala> ( (2 + 2 ) ) res5: Int = 4 scala> 5 ; ( (2 + 2 ) ) ; ((5)) +<console>:7: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses + 5 ; ( (2 + 2 ) ) ;; + ^ +<console>:7: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses + 5 ; ( (2 + 2 ) ) ;; + ^ res6: Int = 5 scala> (((2 + 2)), ((2 + 2))) @@ -34,9 +40,18 @@ res9: String = 4423 scala> scala> 55 ; ((2 + 2)) ; (1, 2, 3) +<console>:7: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses + 55 ; ((2 + 2)) ;; + ^ +<console>:7: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses + 55 ; ((2 + 2)) ;; + ^ res10: (Int, Int, Int) = (1,2,3) scala> 55 ; (x: Int) => x + 1 ; () => ((5)) +<console>:7: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses + 55 ; (x: Int) => x + 1 ;; + ^ res11: () => Int = <function0> scala> @@ -45,6 +60,9 @@ scala> () => 5 res12: () => Int = <function0> scala> 55 ; () => 5 +<console>:7: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses + 55 ;; + ^ res13: () => Int = <function0> scala> () => { class X ; new X } |