Skip to content

Commit 8331546

Browse files
committed
Add missing get_proper_type
1 parent c4baf4e commit 8331546

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

mypy/checkexpr.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2013,10 +2013,11 @@ def infer_function_type_arguments_using_context(
20132013
# variables in an expression are inferred at the same time.
20142014
# (And this is hard, also we need to be careful with lambdas that require
20152015
# two passes.)
2016+
proper_ret = get_proper_type(ret_type)
20162017
if (
2017-
isinstance(ret_type, TypeVarType)
2018-
or isinstance(ret_type, UnionType)
2019-
and all(isinstance(u, TypeVarType) for u in ret_type.items)
2018+
isinstance(proper_ret, TypeVarType)
2019+
or isinstance(proper_ret, UnionType)
2020+
and all(isinstance(get_proper_type(u), TypeVarType) for u in proper_ret.items)
20202021
):
20212022
# Another special case: the return type is a type variable. If it's unrestricted,
20222023
# we could infer a too general type for the type variable if we use context,

0 commit comments

Comments
 (0)