Skip to content

Commit 3a081d8

Browse files
committed
Fix selfcheck
1 parent 07286d7 commit 3a081d8

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

mypy/checker.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2337,7 +2337,11 @@ def check_method_override_for_base_with_name(
23372337
return False
23382338

23392339
def get_property_instance(self, method: Decorator | OverloadedFuncDef) -> Instance | None:
2340+
if method.type is None:
2341+
return None
23402342
deco = method if isinstance(method, Decorator) else method.items[0]
2343+
if not isinstance(deco, Decorator):
2344+
return None
23412345
property_deco_name = next(
23422346
(
23432347
name

mypy/checker_shared.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
LambdaExpr,
2222
MypyFile,
2323
Node,
24+
OverloadedFuncDef,
2425
RefExpr,
2526
SymbolNode,
2627
TypeInfo,
@@ -279,7 +280,7 @@ def get_precise_awaitable_type(self, typ: Type, local_errors: ErrorWatcher) -> T
279280
raise NotImplementedError
280281

281282
@abstractmethod
282-
def get_property_instance(self, method: Decorator) -> Instance | None:
283+
def get_property_instance(self, method: Decorator | OverloadedFuncDef) -> Instance | None:
283284
raise NotImplementedError
284285

285286
@abstractmethod

0 commit comments

Comments
 (0)