Merge pull request #15678 from Microsoft/master_allowSpreadGenericType

[Master] Allow spread generic type
This commit is contained in:
Yui
2017-05-08 15:57:11 -07:00
committed by GitHub
12 changed files with 132 additions and 186 deletions

View File

@@ -13285,11 +13285,7 @@ namespace ts {
attributesArray = [];
attributesTable = createMap<Symbol>();
}
const exprType = checkExpression(attributeDecl.expression);
if (!isValidSpreadType(exprType)) {
error(attributeDecl, Diagnostics.Spread_types_may_only_be_created_from_object_types);
hasSpreadAnyType = true;
}
const exprType = getApparentType(checkExpression(attributeDecl.expression));
if (isTypeAny(exprType)) {
hasSpreadAnyType = true;
}