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

easy-includes #269

Closed
Debbl opened this issue Oct 24, 2022 · 3 comments
Closed

easy-includes #269

Debbl opened this issue Oct 24, 2022 · 3 comments

Comments

@Debbl
Copy link

Debbl commented Oct 24, 2022

E.g. if you write `2 extends 1 | 2`, what TypeScript will do is actually replace
it with two conditionals `2 extends 1` and `2 extends 2`.

This is a Conditional Types, but this description looks like a Distributive Conditional Types, is there a problem with my understanding? thank you.

@ghaiklor
Copy link
Owner

No, these are Distributive Conditional Types, you are right.

@Debbl
Copy link
Author

Debbl commented Oct 25, 2022

I don't quite understand, if this is a Distributive Conditional Types, it is replaced with two conditionals 2 extends 1 and 2 extends 2, then return false | true a Union Types. Is thera a problem with this understanding.

@ghaiklor
Copy link
Owner

I can't understand your question, feel free to navigate into the comments section on the website.

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