Hello
When the function prototypes are generated in the ino > cpp preprocessing, return types that are nested types are incorrectly reduced to just the inner type, and compilation fails.
This does not happen in the Arduino IDE, so it's probably not their bug.
How to reproduce:
Create a C.h header, and in it a class:
class C
{
public:
enum E { EA, EB };
};
In the .ino file include "C.h" and add a function:
C::E f()
{
return C::EA;
}
The compilation will fail with "error: 'E' does not name a type".
Looking in the cpp file generated by preprocessing the ino file, the function prototype is:
//
E f();
Which fails, since "E" is not a valid type.
An easy workaround is to declare/implement the function in .h/.cpp files. But figuring out the problem is not trivial, since the error message makes no sense - until one inspects the generated code.
Regards
Cristian Bontas