mirror of
https://github.com/swc-project/swc.git
synced 2024-12-24 22:22:34 +03:00
b887b30092
**Description:** This is required for https://github.com/swc-project/swc/pull/6981 and https://github.com/swc-project/swc/pull/6950
27 lines
491 B
TypeScript
27 lines
491 B
TypeScript
let x: "foo";
|
|
let y: "foo" | "bar";
|
|
let z: "bar";
|
|
|
|
declare function randBool(): boolean;
|
|
|
|
switch (x) {
|
|
case randBool() ? "foo" : "baz":
|
|
break;
|
|
case (randBool() ? ("bar") : "baz" ? "bar" : "baz"):
|
|
break;
|
|
case (("bar")):
|
|
break;
|
|
case (x, y, ("baz")):
|
|
x;
|
|
y;
|
|
break;
|
|
case (("foo" || ("bar"))):
|
|
break;
|
|
case (("bar" || ("baz"))):
|
|
break;
|
|
case z || "baz":
|
|
case "baz" || z:
|
|
z;
|
|
break;
|
|
}
|