Skip to content

Commit 2b33e5c

Browse files
committed
Revert #53059
1 parent bd1e975 commit 2b33e5c

File tree

2 files changed

+0
-40
lines changed

2 files changed

+0
-40
lines changed

src/compiler/checker.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21698,17 +21698,6 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
2169821698
else if (result = isRelatedTo(getTypeWithThisArgument(constraint, source), target, RecursionFlags.Source, reportErrors && constraint !== unknownType && !(targetFlags & sourceFlags & TypeFlags.TypeParameter), /*headMessage*/ undefined, intersectionState)) {
2169921699
return result;
2170021700
}
21701-
if (sourceFlags & TypeFlags.IndexedAccess) {
21702-
const indexType = (source as IndexedAccessType).indexType;
21703-
if (indexType.flags & TypeFlags.Index) {
21704-
const unresolvedIndexConstraint = getBaseConstraintOfType((indexType as IndexType).type);
21705-
const indexConstraint = unresolvedIndexConstraint && unresolvedIndexConstraint !== noConstraintType ? getIndexType(unresolvedIndexConstraint) : keyofConstraintType;
21706-
const constraint = getIndexedAccessType((source as IndexedAccessType).objectType, indexConstraint);
21707-
if (result = isRelatedTo(constraint, target, RecursionFlags.Source, /*reportErrors*/ false, /*headMessage*/ undefined, intersectionState)) {
21708-
return result;
21709-
}
21710-
}
21711-
}
2171221701
if (isMappedTypeGenericIndexedAccess(source)) {
2171321702
// For an indexed access type { [P in K]: E}[X], above we have already explored an instantiation of E with X
2171421703
// substituted for P. We also want to explore type { [P in K]: E }[C], where C is the constraint of X.

tests/cases/compiler/constraintWithIndexedAccess.ts

Lines changed: 0 additions & 29 deletions
This file was deleted.

0 commit comments

Comments
 (0)