diff --git a/tests/cases/compiler/destructuringAssignmentWithDefault.ts b/tests/cases/compiler/destructuringAssignmentWithDefault.ts index 45ade402eb8..ba00ea7ceee 100644 --- a/tests/cases/compiler/destructuringAssignmentWithDefault.ts +++ b/tests/cases/compiler/destructuringAssignmentWithDefault.ts @@ -2,3 +2,15 @@ const a: { x?: number } = { }; let x = 0; ({x = 1} = a); + +// Repro from #26235 + +function f1(options?: { color?: string, width?: number }) { + let { color, width } = options || {}; + ({ color, width } = options || {}); +} + +function f2(options?: [string?, number?]) { + let [str, num] = options || []; + [str, num] = options || []; +}