Skip to content

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

Merged
ahejlsberg merged 2 commits into
masterfrom
anyDefaultsToAny
Apr 26, 2016
Merged

Variable of type any has initial type any in control flow analysis#8295
ahejlsberg merged 2 commits into
masterfrom
anyDefaultsToAny

Conversation

@ahejlsberg
Copy link
Copy Markdown
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
Copy Markdown
Member

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

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