Closed
Description
Now that the string literal types #5185 are merged in, the type guards based on them would be an awesome addition:
by @ahejlsberg:
Type guards could relate the common kind property to the corresponding object type in the union and narrow the type appropriately in the guarded block.
The original issue #1003 got closed with the following comment:
the remaining part is extending the type guards to support the string literal types. but this should be tracked by a different issue.
A quick search suggests that there isn't a ticket for this yet. So here we go.