compiler accepts 'try' with a simple expression which is not allowed in the spec #4249
=== What steps will reproduce the problem ===
=== What is the expected behavior? ===
The code should not compile. The compiler should give a compilation error.
The syntax specified in the specification, section 6.22, requires a block inside curly braces after the try keyword. A simple expression after try is not allowed.
=== What do you see instead? ===
scala> try 1 res0: Int = 1
=== What versions of the following are you using? ===
The text was updated successfully, but these errors were encountered: