diff options
author | Paul Phillips <paulp@improving.org> | 2012-10-12 22:24:32 -0700 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2012-10-13 07:28:30 -0700 |
commit | 02909f2be30db5c0f79f961cad17e2dc2f026ff4 (patch) | |
tree | 7a47e916ec196d4c8e34832eebacc21b76c4b997 /test/files/neg/unit-returns-value.check | |
parent | 8a984fa0e351de532497450c9c80ddd2f975d32e (diff) | |
download | scala-02909f2be30db5c0f79f961cad17e2dc2f026ff4.tar.gz scala-02909f2be30db5c0f79f961cad17e2dc2f026ff4.tar.bz2 scala-02909f2be30db5c0f79f961cad17e2dc2f026ff4.zip |
Warn about more misplaced expressions.
An identifier being used in statement position is not likely
what was meant when it is a non-lazy getter.
Diffstat (limited to 'test/files/neg/unit-returns-value.check')
-rw-r--r-- | test/files/neg/unit-returns-value.check | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/test/files/neg/unit-returns-value.check b/test/files/neg/unit-returns-value.check index 363946f94d..f30a506ebe 100644 --- a/test/files/neg/unit-returns-value.check +++ b/test/files/neg/unit-returns-value.check @@ -4,6 +4,12 @@ unit-returns-value.scala:4: warning: a pure expression does nothing in statement unit-returns-value.scala:4: warning: enclosing method f has result type Unit: return value discarded if (b) return 5 ^ +unit-returns-value.scala:22: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses + i1 // warn + ^ +unit-returns-value.scala:23: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses + i2 // warn + ^ error: No warnings can be incurred under -Xfatal-warnings. -two warnings found +four warnings found one error found |