Skip to content

Commit d0795af

Browse files
committed
Add regression tests
1 parent 5c7823c commit d0795af

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tests/cases/compiler/destructuringAssignmentWithDefault.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,15 @@
22
const a: { x?: number } = { };
33
let x = 0;
44
({x = 1} = a);
5+
6+
// Repro from #26235
7+
8+
function f1(options?: { color?: string, width?: number }) {
9+
let { color, width } = options || {};
10+
({ color, width } = options || {});
11+
}
12+
13+
function f2(options?: [string?, number?]) {
14+
let [str, num] = options || [];
15+
[str, num] = options || [];
16+
}

0 commit comments

Comments
 (0)