From 9ef5f6817688f814a3450126aa7383b0928e80a0 Mon Sep 17 00:00:00 2001 From: Samuel Gruetter Date: Wed, 12 Mar 2014 22:44:33 +0100 Subject: add tests from scala/test/files/{pos,neg} with explicit Unit return type --- tests/untried/neg/nonlocal-warning.check | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 tests/untried/neg/nonlocal-warning.check (limited to 'tests/untried/neg/nonlocal-warning.check') diff --git a/tests/untried/neg/nonlocal-warning.check b/tests/untried/neg/nonlocal-warning.check new file mode 100644 index 000000000..5202df655 --- /dev/null +++ b/tests/untried/neg/nonlocal-warning.check @@ -0,0 +1,9 @@ +nonlocal-warning.scala:4: warning: This catches all Throwables. If this is really intended, use `case x : Throwable` to clear this warning. + catch { case x => 11 } + ^ +nonlocal-warning.scala:2: warning: catch block may intercept non-local return from method foo + def foo(l: List[Int]): Int = { + ^ +error: No warnings can be incurred under -Xfatal-warnings. +two warnings found +one error found -- cgit v1.2.3