File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -7657,15 +7657,20 @@ namespace ts {
7657
7657
return hasNonCircularBaseConstraint(type) ? getConstraintFromIndexedAccess(type) : undefined;
7658
7658
}
7659
7659
7660
+ function getSimplifiedTypeOrConstraint(type: Type) {
7661
+ const simplified = getSimplifiedType(type, /*writing*/ false);
7662
+ return simplified !== type ? simplified : getConstraintOfType(type);
7663
+ }
7664
+
7660
7665
function getConstraintFromIndexedAccess(type: IndexedAccessType) {
7661
- const indexConstraint = getConstraintOfType (type.indexType);
7666
+ const indexConstraint = getSimplifiedTypeOrConstraint (type.indexType);
7662
7667
if (indexConstraint && indexConstraint !== type.indexType) {
7663
7668
const indexedAccess = getIndexedAccessTypeOrUndefined(type.objectType, indexConstraint);
7664
7669
if (indexedAccess) {
7665
7670
return indexedAccess;
7666
7671
}
7667
7672
}
7668
- const objectConstraint = getConstraintOfType (type.objectType);
7673
+ const objectConstraint = getSimplifiedTypeOrConstraint (type.objectType);
7669
7674
if (objectConstraint && objectConstraint !== type.objectType) {
7670
7675
return getIndexedAccessTypeOrUndefined(objectConstraint, type.indexType);
7671
7676
}
You can’t perform that action at this time.
0 commit comments