Skip to content
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

Update usage of assert.never() #5718

Merged
merged 1 commit into from
Apr 13, 2023
Merged

Update usage of assert.never() #5718

merged 1 commit into from
Apr 13, 2023

Conversation

elle-j
Copy link
Contributor

@elle-j elle-j commented Apr 12, 2023

What, How & Why?

Updates return type of assert.never():

  • From: asserts value is never
  • To: never

This change allows TS to detect unreachable code after calling assert.never() without explicitly throwing.

Example old usage:

throw assert.never(eventName, "eventName");

Updated usage:

assert.never(eventName, "eventName");
// Still unreachable

☑️ ToDos

--

Copy link
Contributor

@takameyer takameyer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@elle-j elle-j merged commit 9bdd7cc into main Apr 13, 2023
@elle-j elle-j deleted the lj/assert branch April 13, 2023 13:03
papafe added a commit that referenced this pull request Apr 17, 2023
* main:
  Update core to v13.9.1 (#5739)
  Implement `User.state` (#5712)
  Rename `local-mongodb` to enable app replacements (#5734)
  Update return type of 'assert.never'. (#5718)
  Run tests after builds are done, regardless of they failed or succeeded (#5729)
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants