There was an error while loading. Please reload this page.
Reported by @wycats. Compile this under strictNullChecks and noImplicitAny.
strictNullChecks
noImplicitAny
declare function someAbstraction(x: any): any; let x: string; someAbstraction(() => { x = "hello"; }); // All of the following are errors. x; x as any; x!;
I'd argue that both type assertions should be able to signal to the type system that the variable has been initialized.