Closed
Description
TypeScript Version: 2.9.0-dev.201xxxxx
Search Terms:
Code
let x = null;
function foo () {
if (!x) { // CodeFix all
x = 22;
}
}
function bar() {
console.log(x);
}
Expected behavior:
let x: number | null = null;
function foo () {
if (!x) {
x = 22;
}
}
function bar() {
console.log(x);
}
Actual behavior:
let x: number: number: number = null;
function foo () {
if (!x) {
x = 22;
}
}
function bar() {
console.log(x);
}
Playground Link:
Related Issues: