File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6249,15 +6249,16 @@ def conditional_callable_type_map(
62496249 if not current_type :
62506250 return {}, {}
62516251
6252- if isinstance (get_proper_type (current_type ), AnyType ):
6252+ proper_type = get_proper_type (current_type )
6253+ if isinstance (proper_type , AnyType ):
62536254 # Narrow Any to a generic callable type to satisfy no-any-return in strict mode.
62546255 return {
62556256 expr : CallableType (
6256- [AnyType (TypeOfAny .from_another_any , source_any = current_type ),
6257- AnyType (TypeOfAny .from_another_any , source_any = current_type )],
6257+ [AnyType (TypeOfAny .from_another_any , source_any = proper_type ),
6258+ AnyType (TypeOfAny .from_another_any , source_any = proper_type )],
62586259 [nodes .ARG_STAR , nodes .ARG_STAR2 ],
62596260 [None , None ],
6260- ret_type = AnyType (TypeOfAny .from_another_any , source_any = current_type ),
6261+ ret_type = AnyType (TypeOfAny .from_another_any , source_any = proper_type ),
62616262 fallback = self .named_type ("builtins.function" ),
62626263 is_ellipsis_args = True ,
62636264 )
You can’t perform that action at this time.
0 commit comments