Skip to content

Commit 0fc0efc

Browse files
committed
fix self check
1 parent a9c6318 commit 0fc0efc

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

mypy/checker.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4895,15 +4895,18 @@ def infer_context_dependent(
48954895
return typ
48964896

48974897
@staticmethod
4898-
def is_notimplemented(t: ProperType) -> Type:
4898+
def is_notimplemented(t: ProperType) -> bool:
48994899
return isinstance(t, Instance) and t.type.fullname == "builtins._NotImplementedType"
49004900

49014901
@classmethod
4902-
def erase_notimplemented(cls, t: ProperType) -> Type:
4902+
def erase_notimplemented(cls, t: Type) -> Type:
4903+
t = get_proper_type(t)
49034904
if cls.is_notimplemented(t):
49044905
return AnyType(TypeOfAny.special_form)
49054906
if isinstance(t, UnionType):
4906-
return UnionType.make_union([i for i in t.items if not cls.is_notimplemented(i)])
4907+
return UnionType.make_union(
4908+
[i for i in t.items if not cls.is_notimplemented(get_proper_type(i))]
4909+
)
49074910
return t
49084911

49094912
def check_return_stmt(self, s: ReturnStmt) -> None:

0 commit comments

Comments
 (0)