-
Notifications
You must be signed in to change notification settings - Fork 57
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
type-challenges-solutions/en/easy-if #315
Comments
Hey! type If<C, T, F> = C extends true ? T : F; |
@AurelienWebnation maybe the type system became smart enough to figure it out? Try on the older versions of TypeScript if you are interested in getting an answer to this. |
Such a solution will be more precise
|
@shadaxv I think your |
This is correct for cases with a boolean type, but if you send another type and comment it out with |
Hi, using this type IF<T, K, L> = T extends true? K: L; |
You have something wrong, because the code you showed will return "false" |
If
This project is aimed at helping you better understand how the type system works, writing your own utilities, or just having fun with the challenges.
https://ghaiklor.github.io/type-challenges-solutions/en/easy-if.html
The text was updated successfully, but these errors were encountered: