"does not name a type" error when I have multiple *.ino files and ALL of the code is moved into one

Same here until I bumped into this.

Actually I may also consider (at least for some time) some stupid hack like manually concatenating my files with the rules described in the first post and building from CLI. I don't edit my code within Arduino IDE anyway. I just set board/port and compile/upload the code from it.