You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
typeGeneric<Typeextendsstring>=Type;typeGenericInstance=Generic<any>;typeT1=GenericInstanceextendsGeneric<infer T> ? T : never;// anytypeT2=IsAny<T1>;// true, as it should betypeT3=GenericInstanceextendsGeneric<infer T> ? IsAny<T> : never;// false, but should be true// I guess the second inference removes references to the type being a string?typeT4=GenericInstanceextendsGeneric<infer T> ? IsAny<Textends(infer TT) ? TT : never> : never;// true, as it should be
My wild guess is that it has something to do with the generic constraint <Type extends string> and the returned any is still seen as some sort of string in this case, might be a TS bug?
Upvote & Fund
We're using Polar.sh so you can upvote and help fund this issue.
The funding will be given to active contributors.
Thank you in advance for helping prioritize & fund our backlog.
The text was updated successfully, but these errors were encountered:
Xriuk
changed the title
IsAny not working with some generic types
IsAny not working with "any" as generic type argument under different constraint
Aug 28, 2024
Reproduction
My wild guess is that it has something to do with the generic constraint
<Type extends string>
and the returnedany
is still seen as some sort ofstring
in this case, might be a TS bug?Upvote & Fund
The text was updated successfully, but these errors were encountered: