Allow any type for spreads in JsxExpression

This commit is contained in:
Nathan Shively-Sanders
2016-10-13 10:17:01 -07:00
parent d29c78e718
commit 7eb39cc80c
4 changed files with 24 additions and 1 deletions

View File

@@ -10905,7 +10905,7 @@ namespace ts {
function checkJsxExpression(node: JsxExpression) {
if (node.expression) {
const type = checkExpression(node.expression);
if (node.dotDotDotToken && !isArrayType(type)) {
if (node.dotDotDotToken && type !== anyType && !isArrayType(type)) {
error(node, Diagnostics.JSX_spread_child_must_be_an_array_type, node.toString(), typeToString(type));
}
return type;