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
The enum type of GDScript behaves similarly to that of C/C++ language. That is, we can write some inappropriate operation which may lead bugs:
enumExample {
VALUE_A,
VALUE_B,
}
varexample: Example# CASE1: 10 is neither Example.VALUE_A nor Example.VALUE_Bexample=10# explicit type conversion should be allowedexample=20asExamle# CASE2: +, -, *, / operation usually gives meaningless resultvarexample2=Example.VALUE_A+Example.VALUE_B# use of &, |, ^ (and bit shift?) operator should be allowedexmaple2=Example.VALUE_A&Example.VALUE_B
The text was updated successfully, but these errors were encountered:
heppocogne
changed the title
gdlint feature request: Checking enum variable assignment and
gdlint feature request: Checking enum variable assignment and operations
Oct 6, 2024
The
enum
type of GDScript behaves similarly to that of C/C++ language. That is, we can write some inappropriate operation which may lead bugs:The text was updated successfully, but these errors were encountered: