File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1618,15 +1618,13 @@ def is_unannotated_any(t: Type) -> bool:
16181618 and not self .dynamic_funcs [- 1 ]
16191619 ):
16201620 # Collect return types from return statements
1621- # Merge types from all type maps to get complete picture
1622- all_return_types : list [Type ] = []
1623- for type_map in self ._type_maps :
1624- return_types_list = get_return_types (type_map , item )
1625- all_return_types .extend (return_types_list )
1621+ # Use the master type map (first in stack) where final types are stored
1622+ # At this point in type checking, return statement types should be in the master map
1623+ return_types_list = get_return_types (self ._type_maps [0 ], item )
16261624
1627- if all_return_types :
1625+ if return_types_list :
16281626 # Create union of all return types
1629- inferred_ret_type = make_simplified_union (all_return_types )
1627+ inferred_ret_type = make_simplified_union (return_types_list )
16301628 # Update the function's return type
16311629 typ = typ .copy_modified (ret_type = inferred_ret_type )
16321630 item .type = typ
You can’t perform that action at this time.
0 commit comments