Skip to content

Ban unreachable code.#104521

Merged
mjbvz merged 3 commits intomicrosoft:masterfrom
mtaran-google:unreachable
Aug 17, 2020
Merged

Ban unreachable code.#104521
mjbvz merged 3 commits intomicrosoft:masterfrom
mtaran-google:unreachable

Conversation

@mtaran-google
Copy link
Copy Markdown
Contributor

This changes unreachable code from a warning presented in the editor to an error. Existing issues all revolved around switching on enums. These were fixed by converting the switches to use a default case, leaving the behavior unchanged in case of new values (e.g. from separately-compiled extensions) creeping in.

This PR fixes #104520

@ghost
Copy link
Copy Markdown

ghost commented Aug 12, 2020

CLA assistant check
All CLA requirements met.

This changes unreachable code from a warning presented in the editor to an error. Existing issues mostly revolved around switching on enums. These were fixed by converting the switches to use a default case, leaving the behavior unchanged in case of new values (e.g. from separately-compiled extensions) creeping in.

Other cases had to do with the assert.fail() function, which throws and so shouldn't have anything following it.
@mjbvz mjbvz self-assigned this Aug 13, 2020
@mjbvz mjbvz added this to the August 2020 milestone Aug 17, 2020
@mjbvz mjbvz merged commit 76bc88f into microsoft:master Aug 17, 2020
@mjbvz
Copy link
Copy Markdown
Collaborator

mjbvz commented Aug 17, 2020

Thanks!

@github-actions github-actions bot locked and limited conversation to collaborators Oct 1, 2020
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.

Ban unreachable code in codebase

3 participants