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(
303303 # ErasedType as we do for non-proper subtyping.
304304 return True
305305
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-
309306 if isinstance (right , UnionType ) and not isinstance (left , UnionType ):
310307 # Normally, when 'left' is not itself a union, the only way
311308 # '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:
629626 if call :
630627 return self ._is_subtype (call , right )
631628 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
634632
635633 def visit_type_var (self , left : TypeVarType ) -> bool :
636634 right = self .right
You can’t perform that action at this time.
0 commit comments