Using an enum in a macro?


I’m trying to build a macro which takes an enumeration as an input, and does a switch on it during its flow.

However, as soon as I use a macro that does any operation with an enum, it fails to compile.

The operation will be flagged as an error, indicating that the name of the enum is invalid, and that an unsigned byte is expected instead. (Default value ‘Forward’ for Selection is invalid: ‘Expected a valid unsigned number for a byte property.’)

See the attached screenshots with a simple example.

Looks like a bug. Is there some way to get around it?

Note that I’m still on 4.2.1.


Containing blueprint:

It’s a bug :frowning:

The workaround:


The workaround is a little awkward, but does work.

The idea behind having the enum on the macro directly was to allow different paths of execution to be chosen from within a singe macro. It’s a little more awkward to need to use a second component (especially when “literal” isn’t suggested when dragging out from the enum pin), but it’s probably still better than needing three different macro.