diff --git a/mypy/checkpattern.py b/mypy/checkpattern.py index 839bec078a2f..22e0248e6be5 100644 --- a/mypy/checkpattern.py +++ b/mypy/checkpattern.py @@ -546,7 +546,7 @@ def visit_class_pattern(self, o: ClassPattern) -> PatternType: typ = self.chk.expr_checker.accept(o.class_ref) p_typ = get_proper_type(typ) if isinstance(type_info, TypeAlias) and not type_info.no_args: - self.msg.fail(message_registry.CLASS_PATTERN_GENERIC_TYPE_ALIAS, o) + self.msg.fail(message_registry.NOT_CALLABLE.format('"TypeAliasType"'), o) return self.early_non_match() elif isinstance(p_typ, FunctionLike) and p_typ.is_type_obj(): typ = fill_typevars_with_any(p_typ.type_object())