diff --git a/mypy/subtypes.py b/mypy/subtypes.py index af35821d7ef4..087e10a04e6f 100644 --- a/mypy/subtypes.py +++ b/mypy/subtypes.py @@ -290,9 +290,12 @@ def visit_instance(self, left: Instance) -> bool: if isinstance(tvar, TypeVarType): if not self.check_type_parameter(lefta, righta, tvar.variance): nominal = False - else: + elif isinstance(tvar, ParamSpecType): if not self.check_type_parameter(lefta, righta, COVARIANT): nominal = False + else: + if not is_equivalent(lefta, righta): + nominal = False if nominal: TypeState.record_subtype_cache_entry(self._subtype_kind, left, right) return nominal