Incrementing the value of an enum is not working
When I tried to loop trough an enum (https://discourse.gnome.org/t/looping-trough-all-elements-of-an-enum-with-a-for-loop/16296) I was not able to increment his value
for (ConfigToken t=0;t<ConfigToken.T_AMOUNT;t++)
I am getting this error:
error: unsupported lvalue in postfix expression.
The weird thing is that, when I write
for (ConfigToken t=0;t<ConfigToken.T_AMOUNT;t=t+1)
I am not getting any warnings, but when I write
for (ConfigToken t=0;t<ConfigToken.T_AMOUNT;t+=1)
I'm getting:
note: Assignment: Unsafe conversion from `int' to `ConfigToken'