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

Ability to trigger warnings instead of errors #21

Open
Amatewasu opened this issue Dec 16, 2022 · 1 comment
Open

Ability to trigger warnings instead of errors #21

Amatewasu opened this issue Dec 16, 2022 · 1 comment

Comments

@Amatewasu
Copy link

Hi, thank you a lot for this great library.

I don't know if it's doable but it would be so great to be able to trigger warnings instead of errors.

One example of a use case is that I check that I handled all the cases, thereby in the future if I add a case, I don't forget to handle it in this piece of code. But when I create a case, I may want to test other parts of the code before handling it here.

const foo: a | b | c = ...;
if (isA(foo)) { ... }
else if (isB(foo)) { ... }
else if (isC(foo)) { ... }
else {
  // we check that we handled all the cases, thereby if we add a case in the future, we will trigger an error
  assert<Equals<typeof foo, never>>();
}
@garronej
Copy link
Owner

Hello @Amatewasu,
Sorry this issue slipped through my radar.

I don't think it's possible unfortunately but it would be nice indeed.

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

No branches or pull requests

2 participants