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
Union types tend to malfunction when used with recursive types for reasons that are internal to TypeScript and this library. But you can make it work, just distribute your union as needed:
Unionextends unknown // let's say `Union` is your union
? RecursiveType<Union>// it gets distributed to another type
: never
...And if this still doesn't work, then it's probably because the recursive type needs to do this deeply. In that case, you're welcome to open an issue, and I'll bring a Up version of that type out.
Search tags, topics
#broken #union #recursive
The text was updated successfully, but these errors were encountered:
Type distribution is now a default. So you don't have to worry about your unions anymore. I recommend that you remove any extends unknown in favor of the utility only (to avoid unnecessary load).
馃 Question
Describe your question
Union types tend to malfunction when used with recursive types for reasons that are internal to TypeScript and this library. But you can make it work, just distribute your union as needed:
...And if this still doesn't work, then it's probably because the recursive type needs to do this deeply. In that case, you're welcome to open an issue, and I'll bring a
Up
version of that type out.Search tags, topics
#broken #union #recursive
The text was updated successfully, but these errors were encountered: