strange behaviour when including additional .ino file + OSC library, ESP32/8266

I think the code below should explain whats going on. I'm quite baffled by this. Any pointers or explanations on why this happens would be greatly appreciated! (Also, let me know if you aren't able to reproduce the problem... I've done this on both Windows (188) and OSX (185), using both ESP32 and ESP8266 targets. (build env's for both set up via board manager).

To set up test example, create a new sketch + one additional blank tab with .ino file.

Note that the actual OSC functionality is not in question here, but simply trying to figure out why the project fails to build under these rather bizzare circumstances of adding another function with the name "setup" inside it.

Thanks in advance!

#include <WiFiUdp.h> //test #1-4
#include <OSCMessage.h> // https://github.com/CNMAT/OSC

//test #6 - uncomment setupBarrr()
//void setupBarrr() {  
//}

void setup() {
  delay(10);
}

void loop() {
  delay(10);
}

void fromHost(OSCMessage &msg, int addressOffset) {
}

//test #1-4 -> move this to other tab
void Foosetup() { //could be setupFoo, setupBlah, etc... same behaviour
   delay(10);  
}

// Test Cases:
//1. #include <WiFiUdp.h> + Foosetup in another_file.ino == fail
//2. comment out line 1: #include <WiFiUdp.h> + Foosetup in another_file.ino == fail
//3. remove line 1: #include <WiFiUdp.h> + Foosetup in another_file.ino == OK
//4. blank 1st line + Foosetup in another_file.ino == fail
//5. Foosetup in this file + any of the above == OK
//6. setupBarrr() in this file + any of the above == OK

// error message for fail cases: variable or field 'fromHost' declared void

Please post the full error message

UKHeliBob:
Please post the full error message

oh yeah, there's a bit more than what I put in the comment:

weird_arduino_bug:16:15: error: variable or field 'fromHost' declared void

 void fromHost(OSCMessage &msg, int addressOffset) {

               ^

weird_arduino_bug:16:15: error: 'OSCMessage' was not declared in this scope

weird_arduino_bug:16:27: error: 'msg' was not declared in this scope

 void fromHost(OSCMessage &msg, int addressOffset) {

                           ^

weird_arduino_bug:16:32: error: expected primary-expression before 'int'

 void fromHost(OSCMessage &msg, int addressOffset) {

solved: see strange compile behaviour with function name containing "setup" · Issue #8657 · arduino/Arduino · GitHub