Enum parameter with UFUNCTION

So this is intended behavior?

but the class header does not have this include statement

Then why does it work for UPROPERTY if it doesn’t even know the enum at all? Because it seems it does know it and it seems it does somehow include the project-header-file (which contains the enums and such) because otherwise UPROPERTY can not work right? Same for structs and everything, those also work.

It’s just UFUNCTION + enum in global class + project header include = compiler error. Any other combinations work including structs.

UPROPERTY + enum in global class + project header include = works fine.

enum in global class + project header include = works fine.

UFUNCTION + struct in global class + project header include = works fine.

Etc.

Because of this extremely rare exception to the rule, I find it so hard to believe that this is intended behavior. And if it is intended, can someone perhaps explain me the design reasons behind this?

1 Like