In the following code sample, I don't understand why "Value 7" gets printed instead of "Default". Case 7, i.e. x=7 is not met because x=6, so why does "Value 7" get printed instead of being skipped and the execution falling through to default?
let x = 6 switch x { case 0...5: println("0 through 5") case 6: fallthrough case 7: println("Value 7") default: println("Default") }
fallthroughsection of the language guide – "Thefallthroughkeyword does not check the case conditions for theswitchcase that it causes execution to fall into. Thefallthroughkeyword simply causes code execution to move directly to the statements inside the next case (ordefaultcase) block, as in C’s standardswitchstatement behavior."