This issue has been closed as 'Won't Fix' due to an extended period of time without updates. If this issue is important to you please let us know by posting on the AnswerHub or UDN, and Epic will re-open the ticket for further review.
If an Enum is defined in ClassA and ClassA is included into the Project.h file, having a UFUNCTION in ClassB that takes the enum as a parameter will fail compile. Only by adding an include statement for ClassA inside of ClassB will the code compile
This is inconsistent with a non-UFUNCTION or UPROPERTY which will compile without issue.
UENUM(BlueprintType) enum class ETeam : uint8 { None UMETA(DisplayName = "None"), Players UMETA(DisplayName = "Players"), Neutrals UMETA(DisplayName = "Neutrals"), Enemies UMETA(DisplayName = "Enemies") };
UFUNCTION(BlueprintCallable, Category = "AmmoReserve")
bool CanDamageTeam(ETeam Teams);
Result:
Project fails to compile by saying "Unrecognized type 'ETeam ' - type must be a UCLASS, USTRUCT or UENUM"
Head over to the existing Questions & Answers thread and let us know what's up.
13 |
Component | UE - Foundation - Core |
---|---|
Affects Versions | 4.11.2 |
Created | May 25, 2016 |
---|---|
Resolved | Mar 26, 2018 |
Updated | Apr 27, 2018 |