mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-06 02:33:53 -06:00
Properly check T[K] constraints in type relationships
This commit is contained in:
parent
855488fc6d
commit
fc641fa275
@ -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;
|
||||
|
||||
@ -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.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user