How to mark delegate as deprecated?

Suppose I have a delegate declared as follows:

DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FAbilityActivateDelegate, UDEPRECATED_Ability*, Ability);

As you can see I still need to pass an object of a deprecated class. But now UHT is complaining:

Function is using a deprecated class: 'UDEPRECATED_Ability'. Function should be marked deprecated as well.

This is the associated property in a class beneath the delegate’s declaration:

UPROPERTY(BlueprintCallable, BlueprintAssignable, meta = (DeprecatedProperty))
FAbilityActivateDelegate OnActivate_DEPRECATED;

I tried using UE_DEPRECATED, DEPRECATED, and renaming FAbilityActivateDelegate to FDEPRECATED_AbilityActivateDelegate or FAbilityActivateDelegate_DEPRECATED but nothing worked.

Any help is highly appreciated.

2 Likes

Had the same problem. The error message is misleading.

Change your declaration from

DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FAbilityActivateDelegate, UDEPRECATED_Ability*, Ability);

to

DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FAbilityActivateDelegate, UDEPRECATED_Ability*, Ability_DEPRECATED)

and that should clear the error.

Can you try to add UE_DEPRECATED(Version, Message)

For example

UE_DEPRECATED(5.0, "This is deprecated !!")
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FAbilityActivateDelegate, UDEPRECATED_Ability*, Ability);