TypeScript/tests/cases/compiler/destructuringWithConstraint.ts
2018-03-23 09:48:00 -07:00

13 lines
205 B
TypeScript

// @strict: true
// Repro from #22823
interface Props {
foo?: boolean;
}
function foo<P extends Props>(props: Readonly<P>) {
let { foo = false } = props;
if (foo === true) { }
}