diff --git a/mypy/types.py b/mypy/types.py index 3da1609421c3..2bc4e336bf2f 100644 --- a/mypy/types.py +++ b/mypy/types.py @@ -576,6 +576,7 @@ def __init__(self, self.implicit = implicit self.is_classmethod_class = is_classmethod_class self.special_sig = special_sig + self.is_classmethod_class = is_classmethod_class self.from_type_type = from_type_type super().__init__(line, column) diff --git a/test-data/unit/check-classes.test b/test-data/unit/check-classes.test index 84932472c858..dd9ee927b2a1 100644 --- a/test-data/unit/check-classes.test +++ b/test-data/unit/check-classes.test @@ -842,7 +842,8 @@ import typing class C: @classmethod def foo(cls) -> None: - cls().bar() + c = None # type: C + c.bar() @abstractmethod def bar(self) -> None: pass
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies: