summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-03-30 14:37:42 +0200
committerGitHub <noreply@github.com>2021-03-30 14:37:42 +0200
commit7c14e987b4a40fe281e2d8af8848a5bc8545a0f5 (patch)
tree0709727dbb80d5507d054da60f033c8d2080dfc7
parent655a913e2273b41037df80ae00c11bed9f98d9a9 (diff)
parent5d9585d83bb13f4bf818f87e93b064d69ec40d9b (diff)
Merge pull request #47492 from vnen/gdscript-typed-arrays
GDScript: Fix array type check on constants
-rw-r--r--modules/gdscript/gdscript_analyzer.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/gdscript/gdscript_analyzer.cpp b/modules/gdscript/gdscript_analyzer.cpp
index 598b36f536..aa9dbfffdb 100644
--- a/modules/gdscript/gdscript_analyzer.cpp
+++ b/modules/gdscript/gdscript_analyzer.cpp
@@ -644,11 +644,11 @@ void GDScriptAnalyzer::resolve_class_interface(GDScriptParser::ClassNode *p_clas
GDScriptParser::DataType datatype = member.constant->get_datatype();
if (member.constant->initializer) {
if (member.constant->initializer->type == GDScriptParser::Node::ARRAY) {
- GDScriptParser::ArrayNode *array = static_cast<GDScriptParser::ArrayNode *>(member.variable->initializer);
+ GDScriptParser::ArrayNode *array = static_cast<GDScriptParser::ArrayNode *>(member.constant->initializer);
const_fold_array(array);
// Can only infer typed array if it has elements.
- if (array->elements.size() > 0 || (member.variable->datatype_specifier != nullptr && specified_type.has_container_element_type())) {
+ if (array->elements.size() > 0 || (member.constant->datatype_specifier != nullptr && specified_type.has_container_element_type())) {
update_array_literal_element_type(specified_type, array);
}
} else if (member.constant->initializer->type == GDScriptParser::Node::DICTIONARY) {