Skip to content

Commit 2dee537

Browse files
committed
fix candidate tox-dev#1
1 parent bfb41d7 commit 2dee537

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/sphinx_autodoc_typehints/__init__.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -718,7 +718,11 @@ def _inject_signature( # noqa: C901
718718
type_aliases = app.config["autodoc_type_aliases"]
719719

720720
for arg_name, arg_type in signature.parameters.items():
721-
annotation = arg_type.annotation if arg_type.annotation in type_aliases else type_hints.get(arg_name)
721+
annotation = (
722+
ForwardRef(arg_type.annotation, is_argument=True, is_class=False)
723+
if arg_type.annotation in type_aliases
724+
else type_hints.get(arg_name)
725+
)
722726

723727
default = signature.parameters[arg_name].default
724728

0 commit comments

Comments
 (0)