I'm not sure that's what GP meant. I understood what he said as "it's hard to write code which correct in logic, types, and which passes correct beautifier which changes logic", and I'd think this is impossible.
The example you gave requires to change logic - because indentation is a part of the logic here.
(Note that compiler warnings give a hint about the bad idea in this code, but nested do's can have this problem without warnings also.)