1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-06 12:20:30 +00:00

GDScript: Allow elements of a parent class in a typed array literal

This commit is contained in:
Dmitrii Maganov
2023-03-28 13:47:24 +03:00
parent f818d2b98f
commit 8655d979a1
4 changed files with 20 additions and 2 deletions

View File

@@ -116,8 +116,8 @@ func test():
assert(duplicated_floats.get_typed_builtin() == TYPE_FLOAT)
var b_objects: Array[B] = [B.new(), null]
assert(b_objects.size() == 2)
var b_objects: Array[B] = [B.new(), B.new() as A, null]
assert(b_objects.size() == 3)
assert(b_objects.get_typed_builtin() == TYPE_OBJECT)
assert(b_objects.get_typed_script() == B)