Skip to content

Commit 60992ca

Browse files
committed
Disable unsound T[K] rule in subtype relations
1 parent d479206 commit 60992ca

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/compiler/checker.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16873,7 +16873,7 @@ namespace ts {
1687316873
else if (target.flags & TypeFlags.IndexedAccess) {
1687416874
// A type S is related to a type T[K] if S is related to C, where C is the base
1687516875
// constraint of T[K] for writing.
16876-
if (relation !== identityRelation) {
16876+
if (relation === assignableRelation || relation === comparableRelation) {
1687716877
const objectType = (<IndexedAccessType>target).objectType;
1687816878
const indexType = (<IndexedAccessType>target).indexType;
1687916879
const baseObjectType = getBaseConstraintOfType(objectType) || objectType;

0 commit comments

Comments
 (0)