diff --git a/mypy/semanal.py b/mypy/semanal.py index 3e3056a9adf7..4128369ace5d 100644 --- a/mypy/semanal.py +++ b/mypy/semanal.py @@ -2855,22 +2855,23 @@ def visit_assignment_stmt(self, s: AssignmentStmt) -> None: if self.check_and_set_up_type_alias(s): s.is_alias_def = True special_form = True - # * type variable definition - elif self.process_typevar_declaration(s): - special_form = True - elif self.process_paramspec_declaration(s): - special_form = True - elif self.process_typevartuple_declaration(s): - special_form = True - # * type constructors - elif self.analyze_namedtuple_assign(s): - special_form = True - elif self.analyze_typeddict_assign(s): - special_form = True - elif self.newtype_analyzer.process_newtype_declaration(s): - special_form = True - elif self.analyze_enum_assign(s): - special_form = True + elif isinstance(s.rvalue, CallExpr): + # * type variable definition + if self.process_typevar_declaration(s): + special_form = True + elif self.process_paramspec_declaration(s): + special_form = True + elif self.process_typevartuple_declaration(s): + special_form = True + # * type constructors + elif self.analyze_namedtuple_assign(s): + special_form = True + elif self.analyze_typeddict_assign(s): + special_form = True + elif self.newtype_analyzer.process_newtype_declaration(s): + special_form = True + elif self.analyze_enum_assign(s): + special_form = True if special_form: self.record_special_form_lvalue(s)