mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-12 20:01:02 -05:00
Simplify nested indexed access types
This commit is contained in:
@@ -8881,7 +8881,9 @@ namespace ts {
|
||||
return type.simplified === circularConstraintType ? type : type.simplified;
|
||||
}
|
||||
type.simplified = circularConstraintType;
|
||||
const objectType = type.objectType;
|
||||
// We recursively simplify the object type as it may in turn be an indexed access type. For example, with
|
||||
// '{ [P in T]: { [Q in U]: number } }[T][U]' we want to first simplify the inner indexed access type.
|
||||
const objectType = getSimplifiedType(type.objectType);
|
||||
if (objectType.flags & TypeFlags.Intersection && isGenericObjectType(objectType)) {
|
||||
// Given an indexed access type T[K], if T is an intersection containing one or more generic types and one or
|
||||
// more object types with only a string index signature, e.g. '(U & V & { [x: string]: D })[K]', return a
|
||||
|
||||
Reference in New Issue
Block a user