Description

When a BlueprintImplementableEvent that takes a custom enum as a parameter is overridden in a Blueprint, it will throw a compile error. The compile error states that the event cannot be overridden because it was declared with a different signature in a parent class. Specifying that the enum is of type uint8 gets past the issue.

This issue only occurs if the BlueprintImplementableEvent has a return type. If the return type is void, the Blueprint compiles without any errors.

REGRESSION:
Yes. This worked fine in 4.13.2. This may be the result of a change in 4.14 where TEnumAsByte is no longer used in generated code.

Steps to Reproduce
  1. Create a new Basic Code project.
  2. Add a new Actor code class to the project.
  3. In the header file for the new Actor class, add the following enum:
    UENUM()
    enum class EMyEventType
    {
    	Clicked,
    	ClickReleased,
    };
    
  4. Add the following function signature to the new Actor class:
    UFUNCTION(BlueprintImplementableEvent, Category = MyEvent, meta = (DisplayName = "HandleMyEvent"))
    bool ReceiveMyEvent(EMyEventType InEventType);
    
  5. Build the project in Visual Studio.
  6. In the Editor, create a Blueprint based on the new Actor class.
  7. Override the function that was created in step 4.

RESULT:
The Blueprint editor shows a Compile error that states: "BlueprintEditorCompileResults:Error: Error Cannot override 'MyActor::ReceiveMyEvent' at HandleMyEvent which was declared in a parent with a different signature"

EXPECTED:
The Blueprint compiles successfully.

WORKAROUND:
Specify that the enum is of type uint8 (enum class EMyEventType : uint8).

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-42479 in the post.

0
Login to Vote

Fixed
ComponentUE - Gameplay - Blueprint
Affects Versions4.14.34.16
Target Fix4.16
Fix Commit3354249
Main Commit3358685
CreatedMar 1, 2017
ResolvedMar 20, 2017
UpdatedApr 27, 2018
View Jira Issue