Skip to content

unusedIdentifierFixes: Factor out nested switch statements and fix implicit fallthrough #15496

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
1 commit merged into from
May 1, 2017

Conversation

ghost
Copy link

@ghost ghost commented May 1, 2017

Fixes #14885

Changes:

  • Move all inner switch statements to their own functions.

  • ForOfStatement handler now asserts the kind of the initializer instead of testing. Previous code would have fallen through and then crashed after casting the VariableDeclaration to a TypeParameter.

  • Removed the handler for CatchClause from the VariableDeclaration handlers.

    • Looks like this was dead code.
    • It wouldn't compile any more now that we are typing varDecl: ts.VariableDeclaration correctly.
    • Caught exceptions aren't marked as unused variables.
    • An identifier is required in a catch clause.

@ghost ghost requested a review from paulvanbrenk May 1, 2017 15:54
@ghost ghost force-pushed the rm_fallthrough branch from c04c7f7 to 3590048 Compare May 1, 2017 16:37
@ghost ghost merged commit 20bba9c into master May 1, 2017
@ghost ghost deleted the rm_fallthrough branch May 1, 2017 17:13
@microsoft microsoft locked and limited conversation to collaborators Jun 14, 2018
This pull request was closed.
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.

2 participants