mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-20 13:45:34 -05:00
Add regression test
This commit is contained in:
12
tests/cases/compiler/destructuringWithConstraint.ts
Normal file
12
tests/cases/compiler/destructuringWithConstraint.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
// @strict: true
|
||||
|
||||
// Repro from #22823
|
||||
|
||||
interface Props {
|
||||
foo?: boolean;
|
||||
}
|
||||
|
||||
function foo<P extends Props>(props: Readonly<P>) {
|
||||
let { foo = false } = props;
|
||||
if (foo === true) { }
|
||||
}
|
||||
Reference in New Issue
Block a user