Skip to content

remove outdated difference of match types with typescript's conditional types #9724

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

Merged
merged 1 commit into from
Sep 4, 2020

Conversation

felher
Copy link
Contributor

@felher felher commented Sep 4, 2020

I think the part about match types supporting variables within the pattern is no longer a difference. Typescript supports binding of variables within the pattern. I've written up a small example:

https://www.typescriptlang.org/play?#code/C4TwDgpgBAogNhAthAdsA8gMwDwA0B8UAvFAFBQVS5QQAewqAJgM5QAUAliphAE6wBKANoBdKAH5YUAFzlK1OgxQsoAbyEBrCCGlRmwXlwDmI3Z259BAXwlTdKCADc+AblKkAxgHsU+mgEZdeCRUDBwUAFdEACM+UUISAGY3b19gGgAmIIRkNCxsdS0dPQNjUxLDFCMrBKgAIkwvLzqUnz8IROyQvJx9SqN44ihkoA

Is the difference outdated or am I just misunderstanding what "Match types can bind variables in type patterns" means?

Typescript supports binding of variables within the pattern
Copy link
Member

@dottybot dottybot left a comment

Choose a reason for hiding this comment

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

Hello, and thank you for opening this PR! 🎉

All contributors have signed the CLA, thank you! ❤️

Have an awesome day! ☀️

Copy link
Member

@smarter smarter left a comment

Choose a reason for hiding this comment

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

Thanks for the information!

@smarter smarter merged commit 349f553 into scala:master Sep 4, 2020
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.

3 participants