You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you access an invalid member of a named enum, the editor won't catch the issue, but an error will be thrown at runtime.
If you do the same thing with an unnamed enum, the editor will flag it immediately.
I understand this is likely because named enums are a Dictionary, but it seems to me that it would be an improvement having named enums get flagged in the editor similar to unnamed enums.
Steps to reproduce
See code in repro section
Minimal reproduction project
enumGAME_STATE {WIN, LOSE}
varstate1_good=GAME_STATE.WINvarstate1_bad=GAME_STATE.DRAW#This will throw an error at runtimeenum {STATE_WIN, STATE_LOSE}
varstate2_good=STATE_WINvarstate2_bad=STATE_DRAW#This will be flagged in the editor
The text was updated successfully, but these errors were encountered:
Calinou
changed the title
GDScript 2.0 : When using Named Enums, accessing invalid members won't be caught while editing
GDScript 2.0: When using named enums, accessing invalid members won't be caught while editing
Apr 26, 2022
Godot version
v4.0.alpha6.official [e4f0fc5]
System information
Windows 10
Issue description
If you access an invalid member of a named enum, the editor won't catch the issue, but an error will be thrown at runtime.
If you do the same thing with an unnamed enum, the editor will flag it immediately.
I understand this is likely because named enums are a Dictionary, but it seems to me that it would be an improvement having named enums get flagged in the editor similar to unnamed enums.
Steps to reproduce
See code in repro section
Minimal reproduction project
The text was updated successfully, but these errors were encountered: