4949 map_type_from_supertype , bind_self , erase_to_bound , make_simplified_union ,
5050 erase_def_to_union_or_bound , erase_to_union_or_bound , coerce_to_literal ,
5151 try_getting_str_literals_from_type , try_getting_int_literals_from_type ,
52- tuple_fallback , is_singleton_type , try_expanding_enum_to_union ,
52+ tuple_fallback , is_singleton_type , try_expanding_sum_type_to_union ,
5353 true_only , false_only , function_type , get_type_vars , custom_special_method ,
5454 is_literal_type_like ,
5555)
@@ -4534,11 +4534,11 @@ def refine_identity_comparison_expression(self,
45344534 if singleton_index == - 1 :
45354535 singleton_index = possible_target_indices [- 1 ]
45364536
4537- enum_name = None
4537+ sum_type_name = None
45384538 target = get_proper_type (target )
45394539 if (isinstance (target , LiteralType ) and
45404540 (target .is_enum_literal () or isinstance (target .value , bool ))):
4541- enum_name = target .fallback .type .fullname
4541+ sum_type_name = target .fallback .type .fullname
45424542
45434543 target_type = [TypeRange (target , is_upper_bound = False )]
45444544
@@ -4559,8 +4559,8 @@ def refine_identity_comparison_expression(self,
45594559 expr = operands [i ]
45604560 expr_type = coerce_to_literal (operand_types [i ])
45614561
4562- if enum_name is not None :
4563- expr_type = try_expanding_enum_to_union (expr_type , enum_name )
4562+ if sum_type_name is not None :
4563+ expr_type = try_expanding_sum_type_to_union (expr_type , sum_type_name )
45644564
45654565 # We intentionally use 'conditional_type_map' directly here instead of
45664566 # 'self.conditional_type_map_with_intersection': we only compute ad-hoc
0 commit comments