We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents a771185 + 7174606 commit 735020fCopy full SHA for 735020f
tests/neg/i8096.scala
@@ -0,0 +1,13 @@
1
+def k: Unit =
2
+ val s: String = try
3
+ "WUT"
4
+ catch case _ => println("caught something") // error: Type Mismatch Error
5
+
6
+ "OK" // warning: A pure expression does nothing in statement position
7
8
+def block: String = try "" catch case _ => () // error: Type Mismatch Error
9
+ "" // error: Expected a toplevel definition
10
11
+def i: Int = try 0 catch
12
+ case _ => () // error: Type Mismatch Error
13
+ 1 // error: Expected a toplevel definition
0 commit comments