diff options
Diffstat (limited to 'test/pending/run')
-rw-r--r-- | test/pending/run/retclosure.check | 1 | ||||
-rw-r--r-- | test/pending/run/retclosure.scala | 23 |
2 files changed, 24 insertions, 0 deletions
diff --git a/test/pending/run/retclosure.check b/test/pending/run/retclosure.check new file mode 100644 index 0000000000..94c4971e4a --- /dev/null +++ b/test/pending/run/retclosure.check @@ -0,0 +1 @@ +check failed: some problem diff --git a/test/pending/run/retclosure.scala b/test/pending/run/retclosure.scala new file mode 100644 index 0000000000..d354cb3586 --- /dev/null +++ b/test/pending/run/retclosure.scala @@ -0,0 +1,23 @@ +/* Test return expressions inside closures. + * + * See bug#834 */ + +object Test { + def response: String = { + def check: Option[String] = { + val closure: String=>Nothing = + p => return Some("some problem") // should return from check + + closure("whatever") + } + + check match { + case Some(problem) => "check failed: " + problem + case None => "ok" + } + } + + def main(args: Array[String]) { + Console.println(response) + } +} |