diff --git a/tests/cases/compiler/destructuringWithConstraint.ts b/tests/cases/compiler/destructuringWithConstraint.ts new file mode 100644 index 00000000000..505cab86c97 --- /dev/null +++ b/tests/cases/compiler/destructuringWithConstraint.ts @@ -0,0 +1,12 @@ +// @strict: true + +// Repro from #22823 + +interface Props { + foo?: boolean; +} + +function foo

(props: Readonly

) { + let { foo = false } = props; + if (foo === true) { } +}