Properly check T[K] constraints in type relationships

This commit is contained in:
Anders Hejlsberg 2017-01-09 16:51:30 -08:00
parent 855488fc6d
commit fc641fa275
2 changed files with 2 additions and 2 deletions

View File

@ -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;

View File

@ -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.