That doesn’t do what you think it does. Since local variables aren’t valid patterns, case inputStateSettings_Str declares a capture variable and will match anything. That means that the var inputStateSettings_Str before the switch is actually an unused variable.
class Test {
static function main() {
var foo:String = "foo"; // can be commented out since it's unused
switch "bar" {
case foo: trace("foo"); // hits this code path
case "bar": trace("bar");
}
}
}
If you’re using VSCode, there’s multiple things that hint at this - both foo variables are greyed out since they’re unused, and any case after the catch-all has a “This case is unused” warning: