@@ -7942,16 +7942,9 @@ namespace ts {
7942
7942
}
7943
7943
}
7944
7944
else if (target.flags & TypeFlags.IndexedAccess) {
7945
- // if we have indexed access types with identical index types, see if relationship holds for
7946
- // the two object types.
7947
- if (source.flags & TypeFlags.IndexedAccess && (<IndexedAccessType>source).indexType === (<IndexedAccessType>target).indexType) {
7948
- if (result = isRelatedTo((<IndexedAccessType>source).objectType, (<IndexedAccessType>target).objectType, reportErrors)) {
7949
- return result;
7950
- }
7951
- }
7952
7945
// A type S is related to a type T[K] if S is related to A[K], where K is string-like and
7953
7946
// A is the apparent type of S.
7954
- const constraint = getBaseConstraintOfType( target);
7947
+ const constraint = getConstraintOfType(<IndexedAccessType> target);
7955
7948
if (constraint) {
7956
7949
if (result = isRelatedTo(source, constraint, reportErrors)) {
7957
7950
errorInfo = saveErrorInfo;
@@ -7998,6 +7991,13 @@ namespace ts {
7998
7991
return result;
7999
7992
}
8000
7993
}
7994
+ else if (target.flags & TypeFlags.IndexedAccess && (<IndexedAccessType>source).indexType === (<IndexedAccessType>target).indexType) {
7995
+ // if we have indexed access types with identical index types, see if relationship holds for
7996
+ // the two object types.
7997
+ if (result = isRelatedTo((<IndexedAccessType>source).objectType, (<IndexedAccessType>target).objectType, reportErrors)) {
7998
+ return result;
7999
+ }
8000
+ }
8001
8001
}
8002
8002
else {
8003
8003
if (getObjectFlags(source) & ObjectFlags.Reference && getObjectFlags(target) & ObjectFlags.Reference && (<TypeReference>source).target === (<TypeReference>target).target) {
0 commit comments