jxmot:
I do realize that "fixes" it, but it's not conducive to how I want to organize the original project file. If that's expected behavior of this compiler are there any alternatives to it? Because IMHO this seems to be more of an error in how the preprocessor is working.
How you want to lay out your file and how the compiler wants the code to be laid out are two different things. And the compiler is the boss ![]()
Try to compile your code for a PC (e.g. using Visual Studio or gcc/g++) and call your testFunc from e.g. setup() or main(). It will give you a very hard time 8)
By the way, it's Arduino's (incomplete) attempt to make it beginner friendly that causes the error (as explained by pert); it's not the compiler.