diff options
author | George Marques <george@gmarqu.es> | 2022-01-27 11:34:33 -0300 |
---|---|---|
committer | George Marques <george@gmarqu.es> | 2022-02-03 13:32:16 -0300 |
commit | ad6e2e82a9e2f7e6f6db99a7be474a1f2f2739bf (patch) | |
tree | ae31aceea86a096265e7885f76e4d4d7d9da8659 /modules/gdscript/gdscript_parser.h | |
parent | 82efb1d262aea24b5f742820017fd11c496c3f8c (diff) | |
download | redot-engine-ad6e2e82a9e2f7e6f6db99a7be474a1f2f2739bf.tar.gz |
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_parser.h')
-rw-r--r-- | modules/gdscript/gdscript_parser.h | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/modules/gdscript/gdscript_parser.h b/modules/gdscript/gdscript_parser.h index e4311d2d5e..c09b07282f 100644 --- a/modules/gdscript/gdscript_parser.h +++ b/modules/gdscript/gdscript_parser.h @@ -106,8 +106,7 @@ public: NATIVE, SCRIPT, CLASS, // GDScript. - ENUM, // Full enumeration. - ENUM_VALUE, // Value from enumeration. + ENUM, // Enumeration. VARIANT, // Can be any type. UNRESOLVED, }; @@ -185,8 +184,6 @@ public: return builtin_type == p_other.builtin_type; case NATIVE: case ENUM: - return native_type == p_other.native_type; - case ENUM_VALUE: return native_type == p_other.native_type && enum_type == p_other.enum_type; case SCRIPT: return script_type == p_other.script_type; |