It seems that it calls an overloaded version which takes the delegate without arguments. I tried create a FEnhancedInputActionHandlerValueSignature manually and pass it in. It still gave me same error.
I checked the source, found that three of the BindActions are defined by a macro DEFINE_BIND_ACTION(HANDLER_SIG), where HANDLER_SIG is one of the three kinds of delegate: FEnhancedInputActionHandlerSignature, FEnhancedInputActionHandlerValueSignature, FEnhancedInputActionHandlerInstanceSignature.
The generated BindAction will take typename HANDLER_SIG::TMethodPtr< UserClass > Func as the action handler.
But somehow when I pass a raw function pointer like the docs does, it calls
template< class FuncType, class UserClass, typename... VarTypes >
FEnhancedInputActionEventBinding& BindAction(const UInputAction* Action, ETriggerEvent TriggerEvent, UserClass* Object, FuncType Func, VarTypes... Vars)
defined on line 371 in EnhancedInputComponent.h
Confusing, hope someone can tell me why.
And…it seems not necessary to mark the handler function UFUNCTION().