Cannot pass TSoftObjectPtr parameter to BlueprintNativeEvent

I want function have TSoftObjectPtr value parameter.
so I wrote this code

UFUNCTION(BlueprintCallable)
void TestFunc(TSoftObjectPtr<UNiagaraSystem> niagara); // works well

It works well but if I change BlueprintCallable to BlueprintNativeEvent

UFUNCTION(BlueprintNativeEvent)
void TestFunc(TSoftObjectPtr<UNiagaraSystem> niagara); // not working
virtual void TestFunc_Implementation(TSoftObjectPtr<UNiagaraSystem> niagara) {};

It’s not working. Compiler request me to change TSoftObjectPtr to reference

UFUNCTION(BlueprintNativeEvent)
void TestFunc(const TSoftObjectPtr<UNiagaraSystem>& niagara); // works now
virtual void TestFunc_Implementation(const TSoftObjectPtr<UNiagaraSystem>& niagara) {};

but why?
why I can’t use value parameter at BlueprintNativeEvent function.
Any help will be appreciated.

Notice that you never have to implement TestFunc itself, you only implement TestFunc_Implementation.
This is because UHT automatically generates an implementation like this :

void YourClass::TestFunc(TSoftObjectPtr<UNiagaraSystem> const& niagara)
{
    //pseudo-code
    if (implemented_in_blueprints)
    {
        call_blueprint_graph("TestFunc", niagara);
    }
    else
    {
        TestFunc_Implementation(niagara);
    }
}

When generating that implementation, UHT takes the liberty to enforce optimization by turning all plain structure parameters into const&. Then you are forced to also use it to makes the signatures match.

In case of BlueprintCallable it is different since UHT doesn’t generate the function for you, you implement it yourself, so there’s no such problem.

Thank you for your detailed explantion!