For me the code compile without that bad change.
There are some warnings...
Bulldog's original code compiled for me too. I was just wondering if my use of casting:(void (*)())(&fan2->handleInterrupt)would function properly, not just compile without error.The warnings depend on what processor I try to compile for. No warnings for Uno. Yes warning for Teensy. IDE 1.82.
I got the warnings for a Mega.
Are there Arduino environments in which that matters?Both variants compile (for a Mega and ESP32) without warnings.The first notation will be at least legal for some years to come IMHO.