Why can't I initialise my TArray of structs this way?

I have a UEnum declared in the usual way. It’s part of a struct, as the first member.

I’m trying to make a TArray of these structs and the compiler just doesn’t recognise them as enums and gives me a massive stack of errors like “no instance of constructor” and “undeclared identifier”. I’ve fallen back on doing this function in Blueprint but I want to know why it doesn’t work, if anyone can help me?

The TArray is initialised like so:

TArray<FMyStruct> ArrayofMyStruct = 
{ 
	{ EMyEnumType1, 0, 1 },
	{ EMyEnumType2,  0, 1 },
	{ EMyEnumType3, 0, 1 }
};

Intellisense just tells me the UEnums are undefined. I’m not sure what I’ve done wrong. The header file with the struct and enums definitions are included. The other values are int32.

 UENUM(BlueprintType)
 enum class EMyEnumType : uint8
 {
     EMyEnumType1         UMETA(DisplayName = "EMyEnumType1"),
     EMyEnumType2        UMETA(DisplayName = "EMyEnumType2"),
     EMyEnumType3        UMETA(DisplayName = "EMyEnumType3")
 };
 
 USTRUCT(BlueprintType)
 struct FMyStruct
 {
     GENERATED_BODY()
 
     UPROPERTY(BlueprintReadWrite, Category = "TestStruct")
     EMyEnumType AUEnum;
 
     UPROPERTY(BlueprintReadWrite, Category = "TestStruct")
     int32 Aint;
 
     UPROPERTY(BlueprintReadWrite, Category = "TestStruct")
     int32 Aint2;
 };

Include the enum and strucy definitions please.

Sometimes, intellisense gives you false messages, so beware ! just focus on the Output log

Enum class members are automaticly namespaced if im not mistaken to name of the type so you should use EMyEnumType::EMyEnumType1 insted of just EMyEnumType1

can you post full compile logs?

No need, namespacing them worked; compiled like a dream. Thanks.