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

match return type inconsistent with 5.x semantics and actual return type #259

Open
joshgummersall opened this issue May 19, 2021 · 2 comments
Labels
Projects

Comments

@joshgummersall
Copy link

I just noticed something strange around the top-level match method.

In version 5.1.0, the match function return type is a union of the return types of the case functions:

Screen Shot 2021-05-18 at 5 46 15 PM

In version 6.3.0, the match function return type is an array of the return types of the case functions:

Screen Shot 2021-05-18 at 5 45 37 PM

When executed, the return type appears to always be consistent with the 5.1.0 return type above.

@joshgummersall
Copy link
Author

I also just noticed that parameter types are not properly inferred for case functions.

In 6.3.0 you get:

Screen Shot 2021-05-19 at 9 32 03 AM

In 5.1.0 you get:

Screen Shot 2021-05-19 at 9 31 03 AM

@yuhr
Copy link
Collaborator

yuhr commented Sep 5, 2021

Hmm, the return type can be fixed easily, but the latter problem (parameter types) seems quite difficult to be resolved, possibly due to inability of TS's type inference, and thus it might need regression to the old implementation before #166, which is very annoying... I'm going to focus on seeking another way around this.

@yuhr yuhr moved this from In progress to Help wanted in Development Nov 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Development
Help wanted
Development

No branches or pull requests

2 participants