Skip to content

Commit c954f78

Browse files
committed
fix unexpanded type check error
1 parent b0ffd6b commit c954f78

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

mypy/checkexpr.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1679,12 +1679,10 @@ def check_callable_call(
16791679
callable_info: TypeInfo | None = None
16801680
if isinstance(callable_node.node, TypeInfo):
16811681
callable_info = callable_node.node
1682-
elif (
1683-
isinstance(callable_node.node, TypeAlias)
1684-
and isinstance(callable_node.node.target, Instance)
1685-
and isinstance(callable_node.node.target.type, TypeInfo)
1686-
):
1687-
callable_info = callable_node.node.target.type
1682+
elif isinstance(callable_node.node, TypeAlias):
1683+
alias_target = get_proper_type(callable_node.node.target)
1684+
if isinstance(alias_target, Instance) and isinstance(alias_target.type, TypeInfo):
1685+
callable_info = callable_node.node.target.type
16881686
if callable_info is not None:
16891687
self.chk.check_deprecated(callee.definition, context)
16901688

0 commit comments

Comments
 (0)