File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -3098,7 +3098,7 @@ namespace ts {
3098
3098
let type: Type;
3099
3099
if (pattern.kind === SyntaxKind.ObjectBindingPattern) {
3100
3100
if (declaration.dotDotDotToken) {
3101
- if (isInvalidValidSpreadType (parentType)) {
3101
+ if (isInvalidSpreadType (parentType)) {
3102
3102
error(declaration, Diagnostics.Rest_types_may_only_be_created_from_object_types);
3103
3103
return unknownType;
3104
3104
}
@@ -11449,7 +11449,7 @@ namespace ts {
11449
11449
typeFlags = 0;
11450
11450
}
11451
11451
const type = checkExpression((memberDecl as SpreadAssignment).expression);
11452
- if (!(type.flags & TypeFlags.Any) && isInvalidValidSpreadType (type)) {
11452
+ if (!(type.flags & TypeFlags.Any) && isInvalidSpreadType (type)) {
11453
11453
error(memberDecl, Diagnostics.Spread_types_may_only_be_created_from_object_types);
11454
11454
return unknownType;
11455
11455
}
@@ -11527,12 +11527,12 @@ namespace ts {
11527
11527
}
11528
11528
}
11529
11529
11530
- function isInvalidValidSpreadType (type: Type): boolean {
11530
+ function isInvalidSpreadType (type: Type): boolean {
11531
11531
if (type.flags & TypeFlags.Object) {
11532
11532
return isGenericMappedType(type);
11533
11533
}
11534
11534
else if (type.flags & TypeFlags.UnionOrIntersection) {
11535
- return forEach((<UnionOrIntersectionType>type).types, isInvalidValidSpreadType );
11535
+ return forEach((<UnionOrIntersectionType>type).types, isInvalidSpreadType );
11536
11536
}
11537
11537
return true;
11538
11538
}
You can’t perform that action at this time.
0 commit comments