Closed jedilando closed 12 years ago
This was intentional (the additions currently says the left operand needs to be a literal) because correctly deducing the operand type is impossible in complex/dynamic cases.
Though seeing that string repetition does deduce to some extent and unary spread works on array slice, making this work probably doesn't hurt.
$ coco -bce '(x + "" + y) * 2'
var __ref;
(__ref = x + "" + y) + __ref;
$ coco -bce '+x[a, b]'
+x[a], +x[b];
Ok, thanks for answer!
compiles correctly into
but
compiles into
As far as I understand example2.co should compile into example1.js
Coco 0.7.5 Windows XP