Skip to content

Commit 045a6d8

Browse files
authored
stubtest: understand override (#18815)
Fixes #18814
1 parent 765a78f commit 045a6d8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

mypy/stubtest.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -858,7 +858,7 @@ def from_overloadedfuncdef(stub: nodes.OverloadedFuncDef) -> Signature[nodes.Arg
858858

859859
all_args: dict[str, list[tuple[nodes.Argument, int]]] = {}
860860
for func in map(_resolve_funcitem_from_decorator, stub.items):
861-
assert func is not None
861+
assert func is not None, "Failed to resolve decorated overload"
862862
args = maybe_strip_cls(stub.name, func.arguments)
863863
for index, arg in enumerate(args):
864864
# For positional-only args, we allow overloads to have different names for the same
@@ -1330,6 +1330,7 @@ def apply_decorator_to_funcitem(
13301330
if (
13311331
decorator.fullname in ("builtins.staticmethod", "abc.abstractmethod")
13321332
or decorator.fullname in mypy.types.OVERLOAD_NAMES
1333+
or decorator.fullname in mypy.types.OVERRIDE_DECORATOR_NAMES
13331334
or decorator.fullname in mypy.types.FINAL_DECORATOR_NAMES
13341335
):
13351336
return func

0 commit comments

Comments
 (0)