Skip to content

Commit 5b0f980

Browse files
committed
Handle has-a relationships for type-hinted arguments in class diagrams
1 parent a054796 commit 5b0f980

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pylint/pyreverse/utils.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -269,9 +269,9 @@ def infer_node(node: Union[astroid.AssignAttr, astroid.AssignName]) -> set:
269269
otherwise return a set of the inferred types using the NodeNG.infer method"""
270270

271271
ann = get_annotation(node)
272-
if ann:
273-
return {ann}
274272
try:
273+
if ann:
274+
return set(ann.infer())
275275
return set(node.infer())
276276
except astroid.InferenceError:
277-
return set()
277+
return {ann} if ann else set()

0 commit comments

Comments
 (0)