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

refactor: add utility to err on unreachable branches #991

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

verytactical
Copy link
Contributor

@verytactical verytactical commented Oct 28, 2024

Issue

Closes #915.

Checklist

  • I have updated CHANGELOG.md
  • I have run all the tests locally and no test failure was reported
  • I have run the linter, formatter and spellchecker
  • I did not do unrelated and/or undiscussed refactorings

@verytactical verytactical requested a review from a team as a code owner October 28, 2024 14:45
@anton-trunov
Copy link
Member

It would be nice to add some usage examples for the new utilities

@anton-trunov
Copy link
Member

Perhaps let's try applying it to the map key/value pair types once #993 is merged

@anton-trunov anton-trunov self-assigned this Nov 6, 2024
@anton-trunov anton-trunov added this to the v1.6.0 milestone Nov 6, 2024
Copy link
Member

@anton-trunov anton-trunov left a comment

Choose a reason for hiding this comment

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

Let's revert changes on switch which are not strictly necessary and keep them only for pairs of key/value types where exhaustivity is desired

return this.interpretStaticCall(ast);
}
}
public interpretExpression = (ast: AstExpression): Value =>
Copy link
Member

Choose a reason for hiding this comment

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

I think this change is not strictly necessary, since a missing case in this switch should be caught by ESLint.

case "int":
return ", int vl";
}
return match(key)
Copy link
Member

Choose a reason for hiding this comment

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

I would say this change is not strictly necessary, ESLint would catch it.

@anton-trunov
Copy link
Member

CI is not all green

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve exhaustiveness checks
3 participants