It strikes me as a bit odd that I have heard of loads of undefined behavior examples from C and C++ but not from other Languages, where I also know that C and C++ are used in many situations where reliability is paramount. A search for 'undefined behavior' here on SO yields almost exclusively C and C++ results.
In a course I'm teaching I would like to also give some examples of weird gotchas or undefined behavior from other major languages. Can someone give a few concrete examples similar to int i; if(--i == i++){...} which lead to undefined behavior in other languages?
For example I understand if(--i == i++){...} is undefined in c++ but defined in c# because of extra sequence points as described here Is (--i == i++) an Undefined Behavior?. I want examples of undefined behavior in other languages which are not unforced errors like forgetting to initialize a variable or not locking shared data.