File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -303,9 +303,6 @@ def _is_subtype(
303
303
# ErasedType as we do for non-proper subtyping.
304
304
return True
305
305
306
- if not proper_subtype and isinstance (right , TypeVarType ) and right .has_default ():
307
- return left .accept (SubtypeVisitor (right .default , subtype_context , proper_subtype ))
308
-
309
306
if isinstance (right , UnionType ) and not isinstance (left , UnionType ):
310
307
# Normally, when 'left' is not itself a union, the only way
311
308
# 'left' can be a subtype of the union 'right' is if it is a
@@ -629,8 +626,9 @@ def visit_instance(self, left: Instance) -> bool:
629
626
if call :
630
627
return self ._is_subtype (call , right )
631
628
return False
632
- else :
633
- return False
629
+ if isinstance (right , TypeVarType ) and right .has_default ():
630
+ return self ._is_subtype (left , right .default )
631
+ return False
634
632
635
633
def visit_type_var (self , left : TypeVarType ) -> bool :
636
634
right = self .right
You can’t perform that action at this time.
0 commit comments