IDE: Visual Studio X/Fire
Version: Elements Version
Target (If relevant): Android/Java/iOS/OSX/Island(Platform)/Net/Net Core
Description:
The Silver parser does not like an #if
block around an individual (or set of) cases in a switch
statement.
Expected Behavior:
if FOO the switch matches case z
in it’s own case,
otherwise it matches in the case _
.
Either way it compiles.
Also: I would expect the “$IFDEF” etc. strings in the error to be localized to the emitting language, e.g. in silver it would be changed to “#if” etc.
Edit: And EOF does not get represented well in “* expected, got *” errors
Actual Behavior:
(A) “E: #endif expected, got case [<file> (<line>)]”
(B) “E: No matching $IFDEF for $ENDIF [<file> (<line>)]”
© “E: closing bracket expected, got [<file> (<line>)]”
Steps:
enum F {
case a
case z
}
let f = F.z
switch f {
#if FOO
case .z: // Error A
break
#endif // Error B
case _:
break
} // Error C