Closed
Description
TypeScript Version: 3.5.0-dev.20190412
Search Terms:
Code
Compile the following ts with --noImplicitAny
let x;
if (Date.now()) {
x = 1;
} else {
x = { obj: true };
}
foo(x);
function foo(y) { }
Expected behavior:
The declaration let x
should produce an implicit any error
Actual behavior:
No error reported. After the assignment, the type of x
is number | { obj: boolean }
Related Issues:
From microsoft/vscode#72193