TypeScript/tests/cases/conformance/types/stringLiteral/stringLiteralMatchedInSwitch01.ts
2015-10-26 15:42:02 -07:00

13 lines
No EOL
185 B
TypeScript

type S = "a" | "b";
type T = S[] | S;
var foo: T;
switch (foo) {
case "a":
case "b":
break;
default:
foo = (foo as S[])[0];
break;
}