We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 949195e commit 0b9d3ceCopy full SHA for 0b9d3ce
1 file changed
mypy/checker.py
@@ -1637,13 +1637,13 @@ def is_unannotated_any(t: Type) -> bool:
1637
and not defn.is_generator
1638
and not defn.is_coroutine
1639
and not self.dynamic_funcs[-1]
1640
+ and item.body is not None
1641
):
1642
# Collect return types from return statements
1643
# Use the master type map (first in stack) where final types are stored
1644
# At this point in type checking, return statement types should be in the master map
1645
finder = ReturnTypeFinder(self._type_maps[0])
- if item.body:
1646
- item.body.accept(finder)
+ item.body.accept(finder)
1647
return_types_list = finder.return_types
1648
1649
if return_types_list:
0 commit comments