5050 map_type_from_supertype , bind_self , erase_to_bound , make_simplified_union ,
5151 erase_def_to_union_or_bound , erase_to_union_or_bound , coerce_to_literal ,
5252 try_getting_str_literals_from_type , try_getting_int_literals_from_type ,
53- tuple_fallback , is_singleton_type , try_expanding_enum_to_union ,
53+ tuple_fallback , is_singleton_type , try_expanding_sum_type_to_union ,
5454 true_only , false_only , function_type , get_type_vars , custom_special_method ,
5555 is_literal_type_like ,
5656)
@@ -4612,11 +4612,11 @@ def refine_identity_comparison_expression(self,
46124612 if singleton_index == - 1 :
46134613 singleton_index = possible_target_indices [- 1 ]
46144614
4615- enum_name = None
4615+ sum_type_name = None
46164616 target = get_proper_type (target )
46174617 if (isinstance (target , LiteralType ) and
46184618 (target .is_enum_literal () or isinstance (target .value , bool ))):
4619- enum_name = target .fallback .type .fullname
4619+ sum_type_name = target .fallback .type .fullname
46204620
46214621 target_type = [TypeRange (target , is_upper_bound = False )]
46224622
@@ -4637,8 +4637,8 @@ def refine_identity_comparison_expression(self,
46374637 expr = operands [i ]
46384638 expr_type = coerce_to_literal (operand_types [i ])
46394639
4640- if enum_name is not None :
4641- expr_type = try_expanding_enum_to_union (expr_type , enum_name )
4640+ if sum_type_name is not None :
4641+ expr_type = try_expanding_sum_type_to_union (expr_type , sum_type_name )
46424642
46434643 # We intentionally use 'conditional_type_map' directly here instead of
46444644 # 'self.conditional_type_map_with_intersection': we only compute ad-hoc
0 commit comments