KEMBAR78
Infer unreachability for await no_return() by hauntsaninja · Pull Request #10458 · python/mypy · GitHub
Skip to content

Conversation

hauntsaninja
Copy link
Collaborator

Fixes #10454

The logic here is similar to what we do in visit_call_expr_inner

Fixes python#10454

The logic here is similar to what we do in visit_call_expr_inner
generator = self.check_method_call_by_name('__await__', t, [], [], ctx)[0]
return self.chk.get_generator_return_type(generator, False)
ret_type = self.chk.get_generator_return_type(generator, False)
if isinstance(ret_type, UninhabitedType) and not ret_type.ambiguous:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

expand ret_type before isinstance

@hauntsaninja hauntsaninja requested a review from TH3CHARLie May 11, 2021 04:58
Copy link
Collaborator

@TH3CHARLie TH3CHARLie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Just have one minor confusion that would not block merging this.

@TH3CHARLie TH3CHARLie merged commit 5eb4de4 into python:master May 11, 2021
@hauntsaninja hauntsaninja deleted the async branch May 11, 2021 05:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Awaiting on Awaitable[Tuple[NoReturn, ...]]

2 participants