Distinguish interfaces based on mutual exclusivity of their property type #29158
Closed
5 tasks done
Labels
Duplicate
An existing issue was already created
Uh oh!
There was an error while loading. Please reload this page.
Suggestion
If two (or more) interfaces have a property with the same name, but in none of those said interfaces does the property share same type. TS should be able to differentiate between those interface(s) when inside conditional blocks where the said property being compared against its possible types is part of the condition
Use Cases
It would eliminate having to use type casting and/or other ugly methods.
Examples
Described in Playground
Checklist
My suggestion meets these guidelines:
The text was updated successfully, but these errors were encountered: