UHT/UBT incorrectly uses TEnumAsByte<> in Generated.CPP

I’ve created an enum and a BlueprintNativeEvent that takes this enum as an argument. Unfortunately when I try to compile the game, compilation fails because the Game.Generated.Cpp file swaps out the argument for a TEnumAsByte instead of a regular enum.

If I manually edit the Generated.CPP file, I can compile - but this is obviously not a good workaround. I don’t want to change my enum to the old ::Type style, since that’ll be a breaking change for other parts of the code.

This is the code I have written:
– .H

UENUM(BlueprintType)
enum class EMissionActivityEvent : uint8
{
	ME_None			UMETA(DisplayName = "None"),
	ME_Scheduled	UMETA(DisplayName = "Scheduled"),
	ME_Created		UMETA(DisplayName = "Created"),
	ME_Completed	UMETA(DisplayName = "Completed"),
	ME_Failed		UMETA(DisplayName = "Failed"),
};

UFUNCTION(BlueprintNativeEvent, Category = "Game Widgets")
void OnMissionNotificationAdded(const EMissionActivityEvent& MissionEvent, const FActiveMission& MissionData);
virtual void OnMissionNotificationAdded_Implementation(const EMissionActivityEvent& MissionEvent, const FActiveMission& MissionData);

-- CPP:

void UGESGame_InGameWidget::OnMissionNotificationAdded_Implementation(const EMissionActivityEvent& MissionEvent, const FActiveMission& MissionData)
{
	// Code Goes Here
}

And THIS is what the GESGame.Generated.CPP file generates for that UFUNCTION, which as you can see is incorrect:

void UGESGame_InGameWidget::OnMissionNotificationAdded(const TEnumAsByte<EMissionActivityEvent>& MissionEvent, const FActiveMission& MissionData)
	{
		GESGame_InGameWidget_eventOnMissionNotificationAdded_Parms Parms;
		Parms.MissionEvent=MissionEvent;
		Parms.MissionData=MissionData;
		ProcessEvent(FindFunctionChecked(GESGAME_OnMissionNotificationAdded),&Parms);
	}

This stops my game from compiling, but i can change the Generated file and it will compile and run fine.

Hi, I also have this problem, and apart from manually changing this, do you know if there is a solution for this yet? maybe some meta parameter that needs to be added to create the proper .generated file?
Thanks

Don’t edit auto generated files ever, there’s no guarantee it won’t be regenerated which would overwrite your manual changes. Have you tried with a non const-ref instead? So in the example above void OnMissionNotificationAdded(const EMissionActivityEvent MissionEvent, const FActiveMission& MissionData); or void OnMissionNotificationAdded(EMissionActivityEvent MissionEvent, const FActiveMission& MissionData);