Open brianush1 opened 1 year ago
import std.stdio; void main() { int x = 5; switch (x) { case 3: int y = x + 2; writeln(y); break; default: int y = x + 3; writeln(y); break; } }
gives Variable "y" has the same name as a variable defined on line 7. on line 11 even though that's perfectly fine
Variable "y" has the same name as a variable defined on line 7.
the bug goes away if default: is replaced with another case whatever:
default:
case whatever:
gives
Variable "y" has the same name as a variable defined on line 7.
on line 11 even though that's perfectly finethe bug goes away if
default:
is replaced with anothercase whatever: