Skip to content

Commit dd2d1c5

Browse files
committed
Was actually needed
1 parent ba8ae71 commit dd2d1c5

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/compiler/checker.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22206,6 +22206,12 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
2220622206
return true;
2220722207
}
2220822208
}
22209+
if (target.flags & TypeFlags.TypeParameter && (target as TypeParameter).isThisType) {
22210+
const constraint = getConstraintOfTypeParameter(target as TypeParameter);
22211+
if (constraint && isTypeRelatedTo(source, constraint, relation)) {
22212+
return true;
22213+
}
22214+
}
2220922215
}
2221022216
if (source.flags & TypeFlags.Object && target.flags & TypeFlags.Object) {
2221122217
const related = relation.get(getRelationKey(source, target, IntersectionState.None, relation, /*ignoreConstraints*/ false));

0 commit comments

Comments
 (0)