Anonymous enum as type in Godot 4

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Karol23

Hi is there a way how to use anonymous enum as type? I would like to have named class representing only an enum. Like this:

class_name CustomType

enum {
a, b, c
}

and then have functions accepting only the enum like this

func set_type(type: CustomType):

but I am getting error about using anonymous enums as type. Only solution I came with is to name the enum. For example

class_name CustomType

enum em {
a, b, c
}

with functions changed to

func set_type(type: CustomType.em):

set_type(CustomType.em.a)

Which is not super bad, but I would like to ged rid of the em prefix. Is there any way?

Thanks