-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Exclude<string, SomeType>
not working as expected
#47178
Comments
|
I am finding this meaning in the wording of the handbook now - it's reference to
... because I'm here - why not? Type system is OK with unions and intersections. What does |
Q. Why isn't this feature supported? It doesn't break anything - it's just not something that's supported right now. See #29317. |
I would love to have a type string & not "" |
making the capabilities / limitations of `Exclude<>` more obvious. see: microsoft/TypeScript#47178
|
Closing via microsoft/TypeScript-Website#2192 |
Possibly this lies between being a Bug and being a blind spot in the documentation (Handbook, in this case), but I can't see any indication in the specification of
Exclude
that it only works to exclude individual types from a union type. I might guess that this is the case from the provided examples, but probably that's not the intent of the documentation.Here is a minimal example of what I'm referring to:
Bug Report
🔎 Search Terms
🕗 Version & Regression Information
⏯ Playground Link
Playground link with relevant code
💻 Code
🙁 Actual behavior
Exclude
did not exclude the suppliedExcludedUnion
("a"
) fromstring
.🙂 Expected behavior
Exclude
excludes"a"
from the defined type. From the handbook:The text was updated successfully, but these errors were encountered: