Compiler Error Message - why?

I think this should work:

var dict = {};
var idx = 0;
dict.put(idx++, 2);


Compiler does not like ++;

Peter