From 60463a8721728545d7d626d96f77e8688084c71f Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Sun, 24 Apr 2011 19:16:10 +0000 Subject: Added warning when someone tries to return a no... Added warning when someone tries to return a non-Unit value from a Unit method, no review. --- test/files/neg/unit-returns-value.check | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 test/files/neg/unit-returns-value.check (limited to 'test/files/neg/unit-returns-value.check') diff --git a/test/files/neg/unit-returns-value.check b/test/files/neg/unit-returns-value.check new file mode 100644 index 0000000000..18368f45ab --- /dev/null +++ b/test/files/neg/unit-returns-value.check @@ -0,0 +1,4 @@ +unit-returns-value.scala:4: error: enclosing method f has result type Unit: return value discarded + if (b) return 5 + ^ +one error found -- cgit v1.2.3