summaryrefslogtreecommitdiff
path: root/modules/gdscript/gdscript_warning.h
diff options
context:
space:
mode:
authorGeorge Marques <george@gmarqu.es>2022-01-27 11:34:33 -0300
committerGeorge Marques <george@gmarqu.es>2022-02-03 13:32:16 -0300
commitad6e2e82a9e2f7e6f6db99a7be474a1f2f2739bf (patch)
treeae31aceea86a096265e7885f76e4d4d7d9da8659 /modules/gdscript/gdscript_warning.h
parent82efb1d262aea24b5f742820017fd11c496c3f8c (diff)
GDScript: Consolidate behavior for assigning enum types
This makes sure that assigning values to enum-typed variables are consistent. Same enum is always valid, different enum is always invalid (without casting) and assigning `int` creates a warning if there is no casting. There are new test cases to ensure this behavior doesn't break in the future.
Diffstat (limited to 'modules/gdscript/gdscript_warning.h')
-rw-r--r--modules/gdscript/gdscript_warning.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/modules/gdscript/gdscript_warning.h b/modules/gdscript/gdscript_warning.h
index 112b40781a..82efe3568f 100644
--- a/modules/gdscript/gdscript_warning.h
+++ b/modules/gdscript/gdscript_warning.h
@@ -70,6 +70,7 @@ public:
REDUNDANT_AWAIT, // await is used but expression is synchronous (not a signal nor a coroutine).
EMPTY_FILE, // A script file is empty.
SHADOWED_GLOBAL_IDENTIFIER, // A global class or function has the same name as variable.
+ INT_ASSIGNED_TO_ENUM, // An integer value was assigned to an enum-typed variable without casting.
WARNING_MAX,
};