diff options
author | Mariano Suligoy <marianognu.easyrpg@gmail.com> | 2021-08-15 16:25:47 -0300 |
---|---|---|
committer | Mariano Suligoy <marianognu.easyrpg@gmail.com> | 2021-08-17 19:44:27 -0300 |
commit | 70c5feb32c0c4cd8c6f6dd2d00f5187f1a57e331 (patch) | |
tree | 488e8317b1482ad9f81a0d7ef0fcb165622602e7 /modules/gdscript/gdscript_analyzer.cpp | |
parent | 7f37e2987a18cb29a206694104194c7adcd5e439 (diff) | |
download | redot-engine-70c5feb32c0c4cd8c6f6dd2d00f5187f1a57e331.tar.gz |
Accept non unnamed enums as valid values for enums. Fixes #49357
Diffstat (limited to 'modules/gdscript/gdscript_analyzer.cpp')
-rw-r--r-- | modules/gdscript/gdscript_analyzer.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/modules/gdscript/gdscript_analyzer.cpp b/modules/gdscript/gdscript_analyzer.cpp index 5e5316f69a..fe6d1a9240 100644 --- a/modules/gdscript/gdscript_analyzer.cpp +++ b/modules/gdscript/gdscript_analyzer.cpp @@ -3499,6 +3499,11 @@ bool GDScriptAnalyzer::is_type_compatible(const GDScriptParser::DataType &p_targ if (p_source.kind == GDScriptParser::DataType::BUILTIN && p_source.builtin_type == Variant::INT) { return true; } + if (p_source.kind == GDScriptParser::DataType::ENUM) { + if (p_source.native_type == p_target.native_type) { + return true; + } + } if (p_source.kind == GDScriptParser::DataType::ENUM_VALUE) { if (p_source.native_type == p_target.native_type && p_target.enum_values.has(p_source.enum_type)) { return true; |