Files
tsgo/testdata/baselines/reference/submodule/compiler/destructuringWithConstraint.js

23 lines
448 B
TypeScript

//// [tests/cases/compiler/destructuringWithConstraint.ts] ////
//// [destructuringWithConstraint.ts]
// Repro from #22823
interface Props {
foo?: boolean;
}
function foo<P extends Props>(props: Readonly<P>) {
let { foo = false } = props;
if (foo === true) { }
}
//// [destructuringWithConstraint.js]
"use strict";
// Repro from #22823
function foo(props) {
let { foo = false } = props;
if (foo === true) { }
}