diff options
Diffstat (limited to 'tests/untried/neg/unit-returns-value.check')
-rw-r--r-- | tests/untried/neg/unit-returns-value.check | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/untried/neg/unit-returns-value.check b/tests/untried/neg/unit-returns-value.check new file mode 100644 index 000000000..f30a506eb --- /dev/null +++ b/tests/untried/neg/unit-returns-value.check @@ -0,0 +1,15 @@ +unit-returns-value.scala:4: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses + if (b) return 5 + ^ +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. +four warnings found +one error found |