I attempted to use a C+±defined enum as a key in a Map. It compiled without any problems and seemed to work without issue until I reopened the project later. From then on, if I tried to open the file, or even right-click it the engine would crash with the following:
Assertion failed: PropertyFlags & CPF_HasGetValueTypeHash [File:D:\Build\++UE4+Release-4.15+Compile\Sync\Engine\Source\Runtime\CoreUObject\Private\UObject\Property.cpp] [Line: 1240]
The enum itself was defined in a BlueprintFunctionLibrary in C++ called Constants.h as follows:
UENUM(BlueprintType)
enum class EKoro : uint8
{
None UMETA(DisplayName = "None"),
Ta UMETA(DisplayName = "Ta"),
Ko UMETA(DisplayName = "Ko"),
Ga UMETA(DisplayName = "Ga"),
Po UMETA(DisplayName = "Po"),
Onu UMETA(DisplayName = "Onu"),
Le UMETA(DisplayName = "Le"),
Av UMETA(DisplayName = "Av"),
Kra UMETA(DisplayName = "Kra"),
Ba UMETA(DisplayName = "Ba"),
Bo UMETA(DisplayName = "Bo"),
Ce UMETA(DisplayName = "Ce"),
De UMETA(DisplayName = "De"),
Fa UMETA(DisplayName = "Fa"),
Fe UMETA(DisplayName = "Fe"),
Su UMETA(DisplayName = "Su"),
Vo UMETA(DisplayName = "Vo")
};
I tried it with another Enum as well; defined in a similar manner (in the same file), and it also crashed the engine. Therefore, it appears there is some issue with hashing C++ defined enums, and because it inherits from uint8, it seems there must be an issue trying to hash that as well.
It should be noted that the engine does not crash, from my limited experiment, if the enum is defined in BP.
I’m not sure if this is a bug or if I’m just missing something, but I’m assuming it’s something that the engine should handle differently than simply crashing with a sort of vague error.
Thanks for any help that can be provided, if any.