Reviving an old
thread since I have exactly the same doubt.
The coersion page that a poster points to, has the following regarding + operator:
As I understand it, since none of the if conditions are met by "listIdx",
- the logic would fall to "
otherwise" :
- listIdx will be coerced to a long
- operator will be applied.
long_with_value_1 + 1 will give a
long_with_value_2 & list[long] will fail.
So here are my questions:
1. Why does list[long] fail?
2. What about option D? listIdx is still an object of the type
string. Just because it does not have quotes around it, why wouldn't the same thing happen to it?
Thanks for any clarifications.