diff --git a/lib/compiler.js b/lib/compiler.js index 93f3dbc..58f91e1 100644 --- a/lib/compiler.js +++ b/lib/compiler.js @@ -171,11 +171,11 @@ function compile(nodes) { var node = array[i]; if (firstType === null) { firstType = node.type; - } else { - if (node.type !== firstType) { - genError("Cannot add value of type " + node.type + " to array of type " + - firstType + ".", node.line, node.column); - } + } else if ((node.type === "Integer" || node.type === "Float") && (firstType === "Integer" || firstType === "Float")) { + // OK. + } else if (node.type !== firstType) { + genError("Cannot add value of type " + node.type + " to array of type " + + firstType + ".", node.line, node.column); } }