UENUM() error - Cast of NULL to Package failed

Hello. I’m trying to create an enumeration. I use this code


    UENUM()
    namespace ESomeEnum
    {
    	enum Type
    	{
    		TestTest
    	};
    }

But I’m getting a runtime error:

This problem starts in MyModule.generated.cpp - in one of the generated functions, namely

Jumping with breakpoints I found that my enum type is not registered in UObjectHash.cpp ObjectHash, i.e. HashObject() function is not called for my object. But why?

Can you just try filling some of the details out for the macro that I end up filling out when it works:


UENUM(BlueprintType)
namespace States {
    enum SUN{
        RISING UMETA(DisplayName = "Rising"),
        SETTING UMETA(DisplayName = "Setting")
    };
}

I’m wondering if the macro needs a value?

Complete guess, can’t test where I currently am.

No, this is not necessary. My enum definition should work. At least I saw such usage all over the engine. Btw, adding UMETA didn’t help.

Right, in that case, when I get home… I’m gonna help yo ***… See if we can solve this together if someone else doesn’t beat me to it.

Yeah, thanks. The trickiest part is that UENUMs work in the engine, they work in my other code. But in this particular case - in my own module - they doesn’t work.

It doesn’t seem to be the code you have added. It’s working fine. Can you make sure that removing the above enumeration actually does fix the error…

Yes, I know that separately from my project it works (I wrote about it). I wonder what I’ve missed that it doesn’t work in my module?