I've run across a strange error. I suspect it has something to do with how .ino files are processed. Here's my code (in a .ino file):
void g() {}
struct XXX { int x; };
void f(XXX s) {}
void setup() {}
void loop() {}
And here are the errors that occur when it is compiled:
....sketch_aug15a.ino:3:8: error: variable or field 'f' declared void
void f(XXX s) {}
^~~
....sketch_aug15a.ino:3:8: error: 'XXX' was not declared in this scopeexit status 1
Compilation error: variable or field 'f' declared void
The error goes away if I delete void g() {}.
It also goes away if I used the struct keyword before XXX s, but that shouldn't be necessary.
It also goes away if I precede the definition of f() with a declaration of f() using the same syntax.
Names can be changed and the error stays, e.g. "f" can be changed to another name.
Any ideas?