(self, e: AwaitExpr, allow_none_return: bool = False)
| 6292 | return self.chk.get_generator_receive_type(return_type, False) |
| 6293 | |
| 6294 | def visit_await_expr(self, e: AwaitExpr, allow_none_return: bool = False) -> Type: |
| 6295 | expected_type = self.type_context[-1] |
| 6296 | if expected_type is not None: |
| 6297 | expected_type = self.chk.named_generic_type("typing.Awaitable", [expected_type]) |
| 6298 | actual_type = get_proper_type(self.accept(e.expr, expected_type)) |
| 6299 | if isinstance(actual_type, AnyType): |
| 6300 | return AnyType(TypeOfAny.from_another_any, source_any=actual_type) |
| 6301 | ret = self.check_awaitable_expr( |
| 6302 | actual_type, e, message_registry.INCOMPATIBLE_TYPES_IN_AWAIT |
| 6303 | ) |
| 6304 | if not allow_none_return and isinstance(get_proper_type(ret), NoneType): |
| 6305 | self.chk.msg.does_not_return_value(None, e) |
| 6306 | return ret |
| 6307 | |
| 6308 | def check_awaitable_expr( |
| 6309 | self, t: Type, ctx: Context, msg: str | ErrorMessage, ignore_binder: bool = False |
no test coverage detected