Files
ValueScript/inputs/passing/switch/fallthrough.ts
2023-07-06 13:44:11 +10:00

24 lines
368 B
TypeScript

//! test_output(["matched 43","matched 42"])
export default function () {
let logs: string[] = [];
switch (21 + 22) {
case 1:
logs.push("matched 1");
break;
case 43:
logs.push("matched 43");
// falls through
case 42:
logs.push("matched 42");
break;
default:
logs.push("default");
}
return logs;
}