File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1602,11 +1602,12 @@ def check_func_def(
16021602
16031603 # Infer return type from return statements if function has no explicit return type annotation
16041604 if isinstance (item , FuncDef ) and isinstance (typ , CallableType ):
1605+
16051606 def is_unannotated_any (t : Type ) -> bool :
16061607 if not isinstance (t , ProperType ):
16071608 return False
16081609 return isinstance (t , AnyType ) and t .type_of_any == TypeOfAny .unannotated
1609-
1610+
16101611 ret_type_proper = get_proper_type (typ .ret_type )
16111612 # Only infer for functions without explicit return type annotations
16121613 # Skip generators and coroutines as they have special return type handling
@@ -1636,7 +1637,7 @@ def visit_func_def(self, o: FuncDef) -> None:
16361637 finder = ReturnTypeFinder (self ._type_maps [0 ])
16371638 item .body .accept (finder )
16381639 return_types_list = finder .return_types
1639-
1640+
16401641 if return_types_list :
16411642 # Create union of all return types
16421643 inferred_ret_type = make_simplified_union (return_types_list )
You can’t perform that action at this time.
0 commit comments