Fix function name
This commit is contained in:
parent
f2e30f6693
commit
5c10764d9b
|
@ -3098,7 +3098,7 @@ namespace ts {
|
||||||
let type: Type;
|
let type: Type;
|
||||||
if (pattern.kind === SyntaxKind.ObjectBindingPattern) {
|
if (pattern.kind === SyntaxKind.ObjectBindingPattern) {
|
||||||
if (declaration.dotDotDotToken) {
|
if (declaration.dotDotDotToken) {
|
||||||
if (isInvalidValidSpreadType(parentType)) {
|
if (isInvalidSpreadType(parentType)) {
|
||||||
error(declaration, Diagnostics.Rest_types_may_only_be_created_from_object_types);
|
error(declaration, Diagnostics.Rest_types_may_only_be_created_from_object_types);
|
||||||
return unknownType;
|
return unknownType;
|
||||||
}
|
}
|
||||||
|
@ -11449,7 +11449,7 @@ namespace ts {
|
||||||
typeFlags = 0;
|
typeFlags = 0;
|
||||||
}
|
}
|
||||||
const type = checkExpression((memberDecl as SpreadAssignment).expression);
|
const type = checkExpression((memberDecl as SpreadAssignment).expression);
|
||||||
if (!(type.flags & TypeFlags.Any) && isInvalidValidSpreadType(type)) {
|
if (!(type.flags & TypeFlags.Any) && isInvalidSpreadType(type)) {
|
||||||
error(memberDecl, Diagnostics.Spread_types_may_only_be_created_from_object_types);
|
error(memberDecl, Diagnostics.Spread_types_may_only_be_created_from_object_types);
|
||||||
return unknownType;
|
return unknownType;
|
||||||
}
|
}
|
||||||
|
@ -11527,12 +11527,12 @@ namespace ts {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function isInvalidValidSpreadType(type: Type): boolean {
|
function isInvalidSpreadType(type: Type): boolean {
|
||||||
if (type.flags & TypeFlags.Object) {
|
if (type.flags & TypeFlags.Object) {
|
||||||
return isGenericMappedType(type);
|
return isGenericMappedType(type);
|
||||||
}
|
}
|
||||||
else if (type.flags & TypeFlags.UnionOrIntersection) {
|
else if (type.flags & TypeFlags.UnionOrIntersection) {
|
||||||
return forEach((<UnionOrIntersectionType>type).types, isInvalidValidSpreadType);
|
return forEach((<UnionOrIntersectionType>type).types, isInvalidSpreadType);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue