Files
scriptc/tests/corpus/conditional-tuple-destructuring.ts
Chris Tate 2069684b40 Expand static Effect support across common APIs (#598)
* Expand static Effect support across common APIs

* Preserve compiler parity across expanded Effect patterns

* Fix compiler regressions exposed by Effect coverage

* Bound shared type conversion traversal

* Clarify conversion contracts and tidy fixtures

* Run every Effect fixture in CI shards

* Preserve inferred array assignments in concurrent Effect programs

* Record inferred array fixture compiler ordering
2026-10-01 02:49:31 -05:00

20 lines
670 B
TypeScript

function select(reverse: boolean, first: string, second: string): string {
const [left, right] = reverse ? [second, first] : [first, second];
return left.toUpperCase() + ":" + right.toLowerCase();
}
console.log(select(false, "One", "Two"), select(true, "One", "Two"));
function choose(reverse: boolean) {
const a = { value: 1 }, b = { value: 2 };
const [left, right, amount] = reverse ? [b, a, 3] : [a, b, 4];
left.value += amount;
console.log(a.value, b.value, right.value);
}
choose(false);
choose(true);
const [only] = [...new Set(["one"])];
console.log(only);
const [first, ...rest] = [...new Set(["a", "b", "c"])];
console.log(first, rest.join(","));