Do not error when spread generic type

This commit is contained in:
Kanchalai Tanglertsampan
2017-05-08 13:31:44 -07:00
parent 47bd4d3a87
commit bb1125a2b6

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;
}