-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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 'string' is not assignable to type 'Exclude<T, number>' when narrowing using generic #54175
Comments
This would probably be a duplicate of #33912 if the return type were changed to Currently if you call |
@jcalz Thanks for the response. This seems reasonable to me, however I've given it a try but unfortunately it's not working. |
Bug Report
🔎 Search Terms
🕗 Version & Regression Information
⏯ Playground Link
https://www.typescriptlang.org/play?ts=5.1.0-dev.20230507#code/GYVwdgxgLglg9mABGEBbARgUwE4BU4DKU2MYA5gDy4B8AFAG4CGANiJgFyK4CUnAogA8IrACaYqAGmRos2aogDeAWABQidYmyYoIbEigBPAA6Y4wRE1aZEAXjuIA5Cgw4HiAPyIABgBIFltgBfL0ROAMwAblVA1VUAejjEEABnRjJMVVBIWAREZMxmTGhcTAEoWihSqE5k4lIyRAAfRAAlTDJBI25FVQ1EBMQoOBE4aNiVLOh4JEYwOCgACxwAMTBaRmwyTmdZJry68j22joEunrUNAcWYZMQbxEZoEBZmA0QAdzhsAGt6qXQQFA8nBUJgFnB3ogADKkawAJjut1qMGYzE0jBu9UGS0QOGwX16Gi0Oj0eQKRSgJTKtB2OHwRBI5HWm243CiKhiKnGkxySFpeEIBzIcKodHCnB4EtxZUwYBEt35Hm8flwwVCXHOfWJun0xlM5nCtnsThkriVvn8LCCITCVsiYy5E3AU1y-PpQoAzKKGHaJbwNVVZfLpC5sEraoyGlLlBd1NrSYYTGYLHajTZHPy3J4LeE1barOzOUA
💻 Code
🙁 Actual behavior
🙂 Expected behavior
There should be no issue, since T is extending
any
by default, hence string should absolutely be included inExclude<T, number>
, where it should beany
type but withoutnumber
The text was updated successfully, but these errors were encountered: