diff options
author | Felix Mulder <felix.mulder@gmail.com> | 2016-09-15 17:31:21 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-09-15 17:31:21 +0200 |
commit | 5d8f132b98ca10e47773275c7048ce132f5f197c (patch) | |
tree | 3dd3838ad2f969a10837d5c1b6ec2b229e0a0929 /tests | |
parent | 70a8426912f6f256536470a046cdf86827ab2c93 (diff) | |
parent | d1eeb5ffd9ee701f0ffce21eac10227328178113 (diff) | |
download | dotty-5d8f132b98ca10e47773275c7048ce132f5f197c.tar.gz dotty-5d8f132b98ca10e47773275c7048ce132f5f197c.tar.bz2 dotty-5d8f132b98ca10e47773275c7048ce132f5f197c.zip |
Merge pull request #1509 from felixmulder/topic/better-try-catch-messages
Better `try` and `catch` messages
Diffstat (limited to 'tests')
-rw-r--r-- | tests/neg/emptyCatch.scala | 3 | ||||
-rw-r--r-- | tests/pos/tryWithoutHandler.scala | 7 |
2 files changed, 10 insertions, 0 deletions
diff --git a/tests/neg/emptyCatch.scala b/tests/neg/emptyCatch.scala new file mode 100644 index 000000000..60951d27a --- /dev/null +++ b/tests/neg/emptyCatch.scala @@ -0,0 +1,3 @@ +object Test { + try {} catch {} // error: `catch` block does not contain a valid expression, try adding a case like - `case e: Exception =>` to the block +} diff --git a/tests/pos/tryWithoutHandler.scala b/tests/pos/tryWithoutHandler.scala new file mode 100644 index 000000000..ffe334984 --- /dev/null +++ b/tests/pos/tryWithoutHandler.scala @@ -0,0 +1,7 @@ +object Test { + def main(args: Array[String]): Unit = { + try { + println("hello") + } + } +} |