Skip to content

fix #11463, null assertion block uninitialized error#14020

Merged
mhegazy merged 2 commits into
microsoft:masterfrom
HerringtonDarkholme:suppress-uninitialize
May 23, 2017
Merged

fix #11463, null assertion block uninitialized error#14020
mhegazy merged 2 commits into
microsoft:masterfrom
HerringtonDarkholme:suppress-uninitialize

Conversation

@HerringtonDarkholme
Copy link
Copy Markdown
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
Copy Markdown
Contributor

mhegazy commented May 22, 2017

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

@HerringtonDarkholme
Copy link
Copy Markdown
Contributor Author

Updated to the latest master.

@mhegazy mhegazy merged commit 2f65b2c into microsoft:master May 23, 2017
@mhegazy
Copy link
Copy Markdown
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