File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff 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,
You can’t perform that action at this time.
0 commit comments