49
49
map_type_from_supertype , bind_self , erase_to_bound , make_simplified_union ,
50
50
erase_def_to_union_or_bound , erase_to_union_or_bound , coerce_to_literal ,
51
51
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 ,
53
53
true_only , false_only , function_type , get_type_vars , custom_special_method ,
54
54
is_literal_type_like ,
55
55
)
@@ -4534,11 +4534,11 @@ def refine_identity_comparison_expression(self,
4534
4534
if singleton_index == - 1 :
4535
4535
singleton_index = possible_target_indices [- 1 ]
4536
4536
4537
- enum_name = None
4537
+ sum_type_name = None
4538
4538
target = get_proper_type (target )
4539
4539
if (isinstance (target , LiteralType ) and
4540
4540
(target .is_enum_literal () or isinstance (target .value , bool ))):
4541
- enum_name = target .fallback .type .fullname
4541
+ sum_type_name = target .fallback .type .fullname
4542
4542
4543
4543
target_type = [TypeRange (target , is_upper_bound = False )]
4544
4544
@@ -4559,8 +4559,8 @@ def refine_identity_comparison_expression(self,
4559
4559
expr = operands [i ]
4560
4560
expr_type = coerce_to_literal (operand_types [i ])
4561
4561
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 )
4564
4564
4565
4565
# We intentionally use 'conditional_type_map' directly here instead of
4566
4566
# 'self.conditional_type_map_with_intersection': we only compute ad-hoc
0 commit comments