diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 2a27a7a7e8a..23cb632b2b1 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -4637,7 +4637,7 @@ namespace ts { let type: Type | undefined; if (pattern.kind === SyntaxKind.ObjectBindingPattern) { if (declaration.dotDotDotToken) { - if (parentType.flags & TypeFlags.Unknown || !isValidSpreadType(parentType)) { + if (parentType.flags & TypeFlags.Unknown || !isValidSpreadType(parentType) || isGenericObjectType(parentType)) { error(declaration, Diagnostics.Rest_types_may_only_be_created_from_object_types); return errorType; }