With --noImplicitAny:
function foo() {
let element = foo() as number;
return element;
}
/*
issue5403.ts(1,10): error TS7023: 'foo' implicitly has return type 'any' because it does not
have a return type annotation and is referenced directly or indirectly in one of its return
expressions.
issue5403.ts(2,6): error TS7022: 'element' implicitly has type 'any' because it does not have
a type annotation and is referenced directly or indirectly in its own initializer.
*/