Skip to content

Remove unused errors/branches in checkGrammarModifiers #47198

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 1 commit into from
Jan 29, 2022
Merged

Remove unused errors/branches in checkGrammarModifiers #47198

merged 1 commit into from
Jan 29, 2022

Conversation

romdotdog
Copy link
Contributor

@romdotdog romdotdog commented Dec 20, 2021

Apologies if I've violated the guidelines by PRing neither a bug nor a feature.

About

While looking around in the code, I noticed that lastStatic! in line 42688 of /src/compiler/checker.ts was probably a bug and should've referenced lastAbstract, but I soon noticed that two of these branches, readonly and abstract, seemed to be unreachable. Playground Link

The solution

We can presumably safely remove these two branches since earlier branches are hit and return another error first.

@typescript-bot typescript-bot added the For Uncommitted Bug PR for untriaged, rejected, closed or missing bug label Dec 20, 2021
@typescript-bot
Copy link
Collaborator

This PR doesn't have any linked issues. Please open an issue that references this PR. From there we can discuss and prioritise.

@sandersn sandersn added the Housekeeping Housekeeping PRs label Jan 29, 2022
@sandersn sandersn self-assigned this Jan 29, 2022
@sandersn
Copy link
Member

Thanks for the PR. A bug isn't strictly needed for a housekeeping fix like this.

@sandersn sandersn merged commit 3e19cc8 into microsoft:main Jan 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
For Uncommitted Bug PR for untriaged, rejected, closed or missing bug Housekeeping Housekeeping PRs
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants