diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 6292f415009..9cc1abb65a3 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -22206,6 +22206,12 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { return true; } } + if (target.flags & TypeFlags.TypeParameter && (target as TypeParameter).isThisType) { + const constraint = getConstraintOfTypeParameter(target as TypeParameter); + if (constraint && isTypeRelatedTo(source, constraint, relation)) { + return true; + } + } } if (source.flags & TypeFlags.Object && target.flags & TypeFlags.Object) { const related = relation.get(getRelationKey(source, target, IntersectionState.None, relation, /*ignoreConstraints*/ false));