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(
80228022 return proposed_type , default
80238023 elif not any (
80248024 type_range .is_upper_bound for type_range in proposed_type_ranges
8025- ) and ( # concrete subtypes
8025+ ) and (
8026+ # concrete subtypes
80268027 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+ (
80308031 isinstance (proposed_type , CallableType )
80318032 or (isinstance (proposed_type , Instance ) and proposed_type .type .is_protocol )
80328033 )
8034+ and is_subtype (current_type , proposed_type , ignore_promotions = True )
80338035 )
80348036 ):
80358037 # Expression is always of one of the types in proposed_type_ranges
You can’t perform that action at this time.
0 commit comments