Browse Source

When analyzing GdScript sources, consider Enums as Dictionaries. Fixes #45558

Mariano Suligoy 4 years ago
parent
commit
7f37e2987a
1 changed files with 4 additions and 1 deletions
  1. 4 1
      modules/gdscript/gdscript_analyzer.cpp

+ 4 - 1
modules/gdscript/gdscript_analyzer.cpp

@@ -2351,7 +2351,10 @@ void GDScriptAnalyzer::reduce_identifier_from_base(GDScriptParser::IdentifierNod
 				result.enum_type = name;
 				result.enum_type = name;
 				p_identifier->set_datatype(result);
 				p_identifier->set_datatype(result);
 			} else {
 			} else {
-				push_error(vformat(R"(Cannot find value "%s" in "%s".)", name, base.to_string()), p_identifier);
+				// Consider as a Dictionary
+				GDScriptParser::DataType dummy;
+				dummy.kind = GDScriptParser::DataType::VARIANT;
+				p_identifier->set_datatype(dummy);
 			}
 			}
 		} else {
 		} else {
 			push_error(R"(Cannot get property from enum value.)", p_identifier);
 			push_error(R"(Cannot get property from enum value.)", p_identifier);