Avoid dependent parameters narrowings if any declared symbol of the parameter is assigned to (#56313)

This commit is contained in:
Mateusz Burzyński
2023-12-11 13:42:30 -08:00
committed by GitHub
parent 973b0e63c1
commit af368780cd
10 changed files with 352 additions and 3 deletions
@@ -0,0 +1,10 @@
// @strict: true
// @noEmit: true
function ff({ a, b }: { a: string | undefined, b: () => void }) {
if (a !== undefined) {
b = () => {
const x: string = a;
}
}
}