From 1c2f3d228cf5634c7afc5bb6501074837358a9bb Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Fri, 23 Mar 2018 09:48:00 -0700 Subject: [PATCH] Add regression test --- tests/cases/compiler/destructuringWithConstraint.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 tests/cases/compiler/destructuringWithConstraint.ts 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) { } +}