Own type definition using a struct does not name a type
This is a bug in the Arduino IDE: when converting your .ino file to a
.cpp file, it added a declaration for the function ledFactory()
before the declaration of the type led_t.
As it appears to be adding those declarations right before the first
function of your sketch, a simple workaround is to put all your type
definitions before your functions.