We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.
The text was updated successfully, but these errors were encountered:
Duplicate #11463
Sorry, something went wrong.
declaring x as string | undefined should make these all work though.
x
string | undefined
No branches or pull requests
Reported by @wycats. Compile this under
strictNullChecks
andnoImplicitAny
.I'd argue that both type assertions should be able to signal to the type system that the variable has been initialized.
The text was updated successfully, but these errors were encountered: