When compiling this type: UMyType* const MyVar, the UHT generates incorrect function signatures, of the form: const UMyType* MyVar. This causes a compile bug.
The problem is the use of BluerpintNativeEvent. According to the code posted, you have a non-const pointer to a const object which does not translate to blueprints. If you make the pointer itself constant (as the generated function attempts to do) or make the UFUNCTION BlueprintCallable rather than a BlueprintNativeEvent then you should be able to compile successfully.
Thanks for the reply, , but you have that the wrong way around. My initial parameter, “UKIRCUser* const Source”, is a const pointer to a non-const object. This is changed by the UHT into a variable pointer to a const object, which you say doesn’t translate to blueprints. Hence the bug report.
You should be able to make your pointer non-const in the declaration but const in the definition. This is legal C++ as value-level consts are ignored in function signatures:
// Header.h
UCLASS()
class UMyClass : public UObject
{
UFUNCTION()
void HandleCommand( UKIRCUser* Source );
};
// Source.cpp
void UMyClass::HandleCommand( UKIRCUser* const Source )
{
// Source is const here
}
This will give you the semantics you want, while avoiding the UHT parsing error.