Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions mypy/checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -959,11 +959,7 @@ def _visit_func_def(self, defn: FuncDef) -> None:
# Function definition overrides a variable initialized via assignment or a
# decorated function.
orig_type = defn.original_def.type
if orig_type is None:
# XXX This can be None, as happens in
# test_testcheck_TypeCheckSuite.testRedefinedFunctionInTryWithElse
self.msg.note("Internal mypy error checking function redefinition", defn)
return
assert orig_type is not None, f"Error checking function redefinition {defn}"
if isinstance(orig_type, PartialType):
if orig_type.type is None:
# Ah this is a partial type. Give it the type of the function.
Expand Down