diff options
author | Yuri Sizov <11782833+YuriSizov@users.noreply.github.com> | 2023-02-06 23:32:47 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-06 23:32:47 +0300 |
commit | 945207885b3cd97012215334e56fcd3139d25e9f (patch) | |
tree | e7338a4c7cecfada472d481fb244346a2fcbccd8 /core/variant/array.cpp | |
parent | c0edea37efeb4602d598e96617befe8f0938f798 (diff) | |
parent | 8400308ab30a2a32731d1c50b53f064edc8cf3ee (diff) | |
download | redot-engine-945207885b3cd97012215334e56fcd3139d25e9f.tar.gz |
Merge pull request #72546 from vonagam/fix-typed-array-can-reference
GDScript: Fix can_reference check for typed arrays
Diffstat (limited to 'core/variant/array.cpp')
-rw-r--r-- | core/variant/array.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/core/variant/array.cpp b/core/variant/array.cpp index 2e1adb9167..d156c35343 100644 --- a/core/variant/array.cpp +++ b/core/variant/array.cpp @@ -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); |