Skip to content

Variable of type any has initial type any in control flow analysis #8295

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

Merged
merged 2 commits into from
Apr 26, 2016

Conversation

ahejlsberg
Copy link
Member

Fixes the following scenario that would previously produce an error:

function foo() {
    try {
    }
    catch (e) {
        console.log(e.message); // e should be of type any, not undefined 
    }
}

@DanielRosenwasser
Copy link
Member

Was there a failing test for this? If not, can we add the one above?

@ahejlsberg
Copy link
Member Author

This is from a local branch converting the compiler itself to --strictNullChecks. Will add a regression test.

@ahejlsberg ahejlsberg merged commit da01975 into master Apr 26, 2016
@mhegazy mhegazy deleted the anyDefaultsToAny branch November 2, 2017 21:05
@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