mirror of
https://github.com/godotengine/godot.git
synced 2025-10-20 08:23:29 +00:00
GDScript: Allow elements of a parent class in a typed array literal
This commit is contained in:
parent
f818d2b98f
commit
8655d979a1
4 changed files with 20 additions and 2 deletions
|
@ -2373,6 +2373,10 @@ void GDScriptAnalyzer::update_array_literal_element_type(GDScriptParser::ArrayNo
|
|||
continue;
|
||||
}
|
||||
if (!is_type_compatible(p_element_type, element_type, true, p_array)) {
|
||||
if (is_type_compatible(element_type, p_element_type)) {
|
||||
mark_node_unsafe(element_node);
|
||||
continue;
|
||||
}
|
||||
push_error(vformat(R"(Cannot have an element of type "%s" in an array of type "Array[%s]".)", element_type.to_string(), p_element_type.to_string()), element_node);
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue