UProperty Tarray whitespace compiler error

Compilation of a TArray of TEnumAsByte fails to compile without spaces between closing ‘>’ characters.
For instance

UPROPERTY(Category = Damage, EditAnywhere) TArray> DamageEffectTypes;

Fails with “Missing ‘>’ in TEnumAsByte”, whereas

UPROPERTY(Category = Damage, EditAnywhere) TArray > DamageEffectTypes;

Compiles successfully with an added space prior to the final ‘>’

Hi lemrysroberts,

I am not too clear on how you are trying to set this up. Would you be able to post your code? In particular, where you define your Enum and the full code for how you are declaring your TArray?

Hi ,

Here’s the total of the code in which the issue occurred:

#pragma once

#include "Components/ActorComponent.h"
#include "DamageEffectSourceComponent.generated.h"

UENUM()
namespace EDamageEffects
{
	enum Type
	{
		Destruction,
		Explosion,
		PlasmaExplosion
	};
}

UCLASS(ClassGroup = Damage, hidecategories = Object, meta = (BlueprintSpawnableComponent))
class UDamageEffectSourceComponent : public USceneComponent
{
	GENERATED_UCLASS_BODY()

public:
	UPROPERTY(Category = Damage, EditAnywhere, BlueprintReadOnly)
	class UParticleSystem* ParticleSystem;

	UPROPERTY(Category = Damage, EditAnywhere, BlueprintReadOnly)
	TArray<TEnumAsByte<EDamageEffects::Type> > DamageEffectTypes;
};

The file fails to compile if the whitespace is removed between closing ‘>’ characters just before DamageEffectTypes.

Thanks for the response!

I copied the setup that you provided, and was unable to reproduce the issue with the extra space removed. What versions of the Editor and Visual Studio are you using?

Hi . Sorry for the slow reply. We were on 4.2 using VS 2013, but following an upgrade to 4.4 this issue no longer occurs.