TypeScript/tests/cases/conformance/controlFlow/controlFlowElementAccess.ts
Nathan Shively-Sanders c080324974
Elt access assignment uses declared, not narrowed type (#27574)
I forgot to do this in #26424.

Fixes #27557
Fixes #27412
2018-10-05 11:30:10 -07:00

10 lines
153 B
TypeScript

let x: { o: boolean } = { o: false }
if (x['o'] === false) {
x['o'] = true
}
const y: [number, number] = [0, 0];
if (y[0] === 0) {
y[0] = -1;
}