Int_as_enum_without_cast

Godot Version

4.1.1

Question

I have used the following line of code:

tween.set_trans(1)

Where tween is a Tween I have created

It works just fine, however I keep recieving the following error message:

W 0:00:00:0714 Integer used when an enum value is expected. If this is intended cast the integer to the enum type.
INT_AS_ENUM_WITHOUT_CAST
image.gd:38

What should I do about it? What bugs could arise from this? Thank you

There will be no bugs, is a warning that tries to makes your code be consistent.

Got it, so it should be safe to ignore if I understood correctly

Still, what can I do to avoid it showing up?

Try:

tween.set_trans(Tween.TRANS_SINE)

1 Like

you can try what soundgnome said or disable the warning through @warning_ignore decorator:

1 Like