From fc641fa2752dfd0049b51516b4ac642ca5850c18 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Mon, 9 Jan 2017 16:51:30 -0800 Subject: [PATCH] Properly check T[K] constraints in type relationships --- src/compiler/checker.ts | 2 +- src/compiler/types.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 3769f2493b3..2bdfe9c0c03 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -7206,7 +7206,7 @@ namespace ts { return related === RelationComparisonResult.Succeeded; } } - if (source.flags & TypeFlags.StructuredOrTypeParameter || target.flags & TypeFlags.StructuredOrTypeParameter) { + if (source.flags & TypeFlags.StructuredOrTypeVariable || target.flags & TypeFlags.StructuredOrTypeVariable) { return checkTypeRelatedTo(source, target, relation, undefined, undefined, undefined); } return false; diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 6eebb0b99d7..8e626384533 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -2803,7 +2803,7 @@ namespace ts { EnumLike = Enum | EnumLiteral, UnionOrIntersection = Union | Intersection, StructuredType = Object | Union | Intersection, - StructuredOrTypeParameter = StructuredType | TypeParameter | Index, + StructuredOrTypeVariable = StructuredType | TypeParameter | Index | IndexedAccess, TypeVariable = TypeParameter | IndexedAccess, // 'Narrowable' types are types where narrowing actually narrows.