1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-15 13:51:40 +00:00

GDScript: Fix can_reference check for typed arrays

This commit is contained in:
Dmitrii Maganov
2023-02-02 00:23:47 +02:00
parent 47c3e3b781
commit 8400308ab3
3 changed files with 25 additions and 24 deletions

View File

@@ -225,6 +225,9 @@ void Array::assign(const Array &p_array) {
_p->array = p_array._p->array;
return;
}
if (typed.type == Variant::OBJECT || source_typed.type == Variant::OBJECT) {
ERR_FAIL_MSG(vformat(R"(Cannot assign contents of "Array[%s]" to "Array[%s]".)", Variant::get_type_name(source_typed.type), Variant::get_type_name(typed.type)));
}
Vector<Variant> array;
array.resize(size);