On Wednesday, 29 April 2015 at 06:37:44 UTC, ketmar wrote:
subj. the code:
void main () {
import std.stdio;
char ch = '!';
switch (ch) {
int n = 42;
case '!': writeln(n, ": wow!"); break;
default:
}
}
i think that such abomination should:
1. be forbidden, or
2. trigger a warning, or
3. execute initializer anyway.
currently the code is allowed, no warnings triggered, yet `n` is
uninitialized. and having uninitialized variable without
"=void" "should
not be".
Please raise an issue in bugzilla. This is obviously an error.