mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
23 lines
448 B
TypeScript
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) { }
|
|
}
|