diff --git a/mypy/semanal.py b/mypy/semanal.py index 10d7904559874..e90ab9f160e0a 100644 --- a/mypy/semanal.py +++ b/mypy/semanal.py @@ -3650,7 +3650,7 @@ def unwrap_final(self, s: AssignmentStmt) -> bool: isinstance(s.rvalue, TempNode) and s.rvalue.no_rhs # Filter duplicate errors, we already reported this: - and not self.type.is_named_tuple + and not (self.type and self.type.is_named_tuple) ): invalid_bare_final = True self.fail("Type in Final[...] can only be omitted if there is an initializer", s)