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

Sure but OP's example is proving that the last tab won't work all the time...

it all black magic voodoo thing the IDE is doing there :scream: :cold_face: and I think it is to best stay away from the non standard capability. There are solid best practices for having separate files when you compile and link, that's what should be used in my view.