Closed
Description
TypeScript Version: 2.2.1
Code
(async () => {
function foo(p: string[]): string[] {
return [];
}
function bar(p: string[]): string[] {
return [];
}
let a1: string[] | undefined = [];
while (true) {
let a2 = foo(a1!);
a1 = await bar(a2);
}
});
With noImplicitAny
and strictNullChecks
turned on, this gives error:
'a2' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer.