Description

A static array based on an enum does not display the enum names in Blueprints if the size of the static array uses an explicit C-style cast with a space between the type being cast to and the enum being used (eg: int32 MyArray[(uint8) ETestEnum::MAX];). If there is no space, then the enum names are displayed in Blueprints as expected.

The explicit cast is required in this case when developing for PS4, which will not allow the implicit cast that would be used otherwise. However, the results of this repro can be seen on Windows.

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, create an enum. For example:
    UENUM(BlueprintType)
    enum class ETestEnum : uint8
    {
    	Foo,
    	Bar,
    	Random,
    	Test,
    	Working,
    	MAX,
    };
    
  4. In the Actor class, add a UPROPERTY that is a static array based on the enum from the previous step. eg:
    UPROPERTY(EditAnywhere)
    int32 MyArray[(uint8) ETestEnum::MAX];
    
  5. Build the project in Visual Studio.
  6. Open the project in the Editor.
  7. Create a Blueprint for the new Actor class.

RESULT:
In the Details panel, the array elements are shown with the enum numbers instead of the enum names.

EXPECTED:
The Details panel shows the array elements with their respective enum names.

WORKAROUND:
Make sure there is no space between the type being cast to and the enum being used with the array (eg. int32 MyArray[(uint8)ETestEnum::MAX];).

Have Comments or More Details?

There's no existing public thread on this issue, so head over toAnswerHub just mention UE-67858 in the post.

1
Login to Vote

Backlogged
ComponentCore
Affects Versions4.19.24.224.20.3
CreatedDec 21, 2018
UpdatedMay 16, 2019