File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -8022,14 +8022,16 @@ def conditional_types(
8022
8022
return proposed_type , default
8023
8023
elif not any (
8024
8024
type_range .is_upper_bound for type_range in proposed_type_ranges
8025
- ) and ( # concrete subtypes
8025
+ ) and (
8026
+ # concrete subtypes
8026
8027
is_proper_subtype (current_type , proposed_type , ignore_promotions = True )
8027
- or ( # structural subtypes
8028
- is_subtype ( current_type , proposed_type , ignore_promotions = True )
8029
- and (
8028
+ # structural subtypes
8029
+ or (
8030
+ (
8030
8031
isinstance (proposed_type , CallableType )
8031
8032
or (isinstance (proposed_type , Instance ) and proposed_type .type .is_protocol )
8032
8033
)
8034
+ and is_subtype (current_type , proposed_type , ignore_promotions = True )
8033
8035
)
8034
8036
):
8035
8037
# Expression is always of one of the types in proposed_type_ranges
You can’t perform that action at this time.
0 commit comments