Skip to content

Commit 3e28c43

Browse files
committed
Fix assign to type
1 parent 6107b0c commit 3e28c43

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

mypy/subtypes.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -636,6 +636,9 @@ def visit_type_var(self, left: TypeVarType) -> bool:
636636
return True
637637
if left.values and self._is_subtype(UnionType.make_union(left.values), right):
638638
return True
639+
if left.has_default():
640+
# Check if correct!
641+
return self._is_subtype(left.default, self.right)
639642
return self._is_subtype(left.upper_bound, self.right)
640643

641644
def visit_param_spec(self, left: ParamSpecType) -> bool:

0 commit comments

Comments
 (0)