We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent aa0e64a commit 9d48047Copy full SHA for 9d48047
src/compiler/checker.ts
@@ -19222,6 +19222,12 @@ namespace ts {
19222
}
19223
19224
function isValidSpreadType(type: Type): boolean {
19225
+ if (type.flags & TypeFlags.Instantiable) {
19226
+ const constraint = getBaseConstraintOfType(type);
19227
+ if (constraint !== undefined) {
19228
+ return isValidSpreadType(constraint);
19229
+ }
19230
19231
return !!(type.flags & (TypeFlags.AnyOrUnknown | TypeFlags.NonPrimitive | TypeFlags.Object | TypeFlags.InstantiableNonPrimitive) ||
19232
getFalsyFlags(type) & TypeFlags.DefinitelyFalsy && isValidSpreadType(removeDefinitelyFalsyTypes(type)) ||
19233
type.flags & TypeFlags.UnionOrIntersection && every((<UnionOrIntersectionType>type).types, isValidSpreadType));
0 commit comments