A lot of work is needed to properly handle all foreach edge cases, which is not going to happen anytime soon. So marking these tests as XFAIL for now.