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 737ccb3 commit 6a67b83Copy full SHA for 6a67b83
mypy/checker.py
@@ -604,8 +604,11 @@ def visit_func_def(self, defn: FuncDef) -> Type:
604
else:
605
# Function definition overrides a variable initialized via assignment.
606
orig_type = defn.original_def.type
607
- # XXX This can be None, as happens in
608
- # test_testcheck_TypeCheckSuite.testRedefinedFunctionInTryWithElse
+ if orig_type is None:
+ # XXX This can be None, as happens in
609
+ # test_testcheck_TypeCheckSuite.testRedefinedFunctionInTryWithElse
610
+ self.msg.note("Internal mypy error checking function redefinition.", defn)
611
+ return None
612
if isinstance(orig_type, PartialType):
613
if orig_type.type is None:
614
# Ah this is a partial type. Give it the type of the function.
0 commit comments