IDE: Visual Studio X/Fire
Version: 10.0.0.2411 (develop)
Target (If relevant): OSX
Description:
The parser does not accept defer
in a switch case.
It is also not accepted in a default:
clause.
Expected Behavior:
Compiles.
The defer block should run at the end of the switch case.
Actual Behavior:
A) E: closing bracket expected, got “defer” [<file> (<line>)]"
B) “E: Declaration expected [<file> (<line>)]”
Steps:
func foo() {
switch 5 {
case 5: // Error A
defer {} // Error B
default: break
}
}