@@ -6097,10 +6097,10 @@ namespace ts {
60976097 }
60986098 const spread = spreadTypes[id] = createType(TypeFlags.Spread) as SpreadType;
60996099 Debug.assert(!!(left.flags & (TypeFlags.Spread | TypeFlags.Object)), "Left flags: " + left.flags.toString(2));
6100- Debug.assert(!!(right.flags & (TypeFlags.TypeParameter | TypeFlags.Intersection | TypeFlags.Object)), "Right flags: " + right.flags.toString(2));
6100+ Debug.assert(!!(right.flags & (TypeFlags.TypeParameter | TypeFlags.Intersection | TypeFlags.Index | TypeFlags.IndexedAccess | TypeFlags. Object)), "Right flags: " + right.flags.toString(2));
61016101 spread.symbol = symbol;
61026102 spread.left = left as SpreadType | ResolvedType;
6103- spread.right = right as TypeParameter | IntersectionType | ResolvedType;
6103+ spread.right = right as TypeParameter | IntersectionType | IndexType | IndexedAccessType | ResolvedType;
61046104 spread.aliasSymbol = aliasSymbol;
61056105 spread.aliasTypeArguments = aliasTypeArguments;
61066106 return spread;
@@ -7173,7 +7173,8 @@ namespace ts {
71737173 spreadTypeRelatedTo(source.right.flags & TypeFlags.Object ? source.left as SpreadType : source,
71747174 target.right.flags & TypeFlags.Object ? target.left as SpreadType : target);
71757175 }
7176- // If both right sides are type parameters or intersections, then they must be identical for the spread types to be related.
7176+ // If both right sides are type parameters, intersections, index types or indexed access types,
7177+ // then they must be identical for the spread types to be related.
71777178 // It also means that the left sides are either spread types or object types.
71787179
71797180 // if one left is object and the other is spread, that means the second has another type parameter. which isn't allowed
0 commit comments