Previously, the following code:
def foo(x):
# type: (unicode) -> None
if isinstance(x, str):
reveal_type(x)
else:
reveal_type(x)
would emit the expected types (str, unicode) in each branch
Post #6114, which removed the use of promotions when doing isinstance,
it only emits that the type is unicode and skips checking the first branch.
Is this bad? Should we be doing something else? Obviously str is not really a subtype of unicode, but there are a lot of places where things declared unicode can actually be str.
I think the intention with the first fix was to mostly to fix Union-related issues, so maybe we need a special case for non-unions? Argh.
Thoughts?