Procházet zdrojové kódy

Merge pull request #29433 from bojidar-bg/29406-dictionary-constant

Properly catch certain errors in Dictionary and Array declarations
Rémi Verschelde před 6 roky
rodič
revize
8cc8383a7f
1 změnil soubory, kde provedl 4 přidání a 0 odebrání
  1. 4 0
      modules/gdscript/gdscript_parser.cpp

+ 4 - 0
modules/gdscript/gdscript_parser.cpp

@@ -6021,7 +6021,11 @@ bool GDScriptParser::_is_type_compatible(const DataType &p_container, const Data
 }
 }
 
 
 GDScriptParser::DataType GDScriptParser::_reduce_node_type(Node *p_node) {
 GDScriptParser::DataType GDScriptParser::_reduce_node_type(Node *p_node) {
+#ifdef DEBUG_ENABLED
+	if (p_node->get_datatype().has_type && p_node->type != Node::TYPE_ARRAY && p_node->type != Node::TYPE_DICTIONARY) {
+#else
 	if (p_node->get_datatype().has_type) {
 	if (p_node->get_datatype().has_type) {
+#endif
 		return p_node->get_datatype();
 		return p_node->get_datatype();
 	}
 	}