Skip to content

Commit fc641fa

Browse files
committed
Properly check T[K] constraints in type relationships
1 parent 855488f commit fc641fa

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/compiler/checker.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7206,7 +7206,7 @@ namespace ts {
72067206
return related === RelationComparisonResult.Succeeded;
72077207
}
72087208
}
7209-
if (source.flags & TypeFlags.StructuredOrTypeParameter || target.flags & TypeFlags.StructuredOrTypeParameter) {
7209+
if (source.flags & TypeFlags.StructuredOrTypeVariable || target.flags & TypeFlags.StructuredOrTypeVariable) {
72107210
return checkTypeRelatedTo(source, target, relation, undefined, undefined, undefined);
72117211
}
72127212
return false;

src/compiler/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2803,7 +2803,7 @@ namespace ts {
28032803
EnumLike = Enum | EnumLiteral,
28042804
UnionOrIntersection = Union | Intersection,
28052805
StructuredType = Object | Union | Intersection,
2806-
StructuredOrTypeParameter = StructuredType | TypeParameter | Index,
2806+
StructuredOrTypeVariable = StructuredType | TypeParameter | Index | IndexedAccess,
28072807
TypeVariable = TypeParameter | IndexedAccess,
28082808

28092809
// 'Narrowable' types are types where narrowing actually narrows.

0 commit comments

Comments
 (0)