mirror of
https://github.com/godotengine/godot.git
synced 2024-12-04 18:14:14 +00:00
GDScript: Fix array type check on constants
They mistakenly pointing to the wrong union member (variable instead of constant).
This commit is contained in:
parent
85e316a5d5
commit
5d9585d83b
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user