Skip to content
New issue

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

fix #11463, null assertion block uninitialized error #14020

Merged
merged 2 commits into from
May 23, 2017

Conversation

HerringtonDarkholme
Copy link
Contributor

Fixes #11463. If an identifier is asserted with !, assume it has been initialized.

The change can be more local by adding the check before reporting uninitialized error, but it seems assumeInitialized can help flow type checking return faster. And it does not impact current type checking. (since we cannot assign nullable value to variable with non-nullable declared type under strictNullChekcs). Your kind review is helpful if I got something wrong here!

Test for new feature is added. Tests related to null | undefined has already been included in function f6.

@mhegazy
Copy link
Contributor

mhegazy commented May 22, 2017

sorry for the delay. @HerringtonDarkholme can you please refresh the PR?

@HerringtonDarkholme
Copy link
Contributor Author

Updated to the latest master.

@mhegazy mhegazy merged commit 2f65b2c into microsoft:master May 23, 2017
@mhegazy
Copy link
Contributor

mhegazy commented May 23, 2017

thanks @HerringtonDarkholme, and sorry for the delay.

@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants