Allow any type for spreads in JsxExpression

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

No files matched your search

+1 -1
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;