You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-05 12:10:55 +00:00
GDScript: Allow elements of a parent class in a typed array literal
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
class Foo: pass
|
||||
class Bar extends Foo: pass
|
||||
class Baz extends Foo: pass
|
||||
|
||||
func test():
|
||||
var typed: Array[Bar] = [Baz.new() as Foo]
|
||||
print('not ok')
|
||||
@@ -0,0 +1,7 @@
|
||||
GDTEST_RUNTIME_ERROR
|
||||
>> ERROR
|
||||
>> on function: assign()
|
||||
>> core/variant/array.cpp
|
||||
>> 222
|
||||
>> Method/function failed.
|
||||
not ok
|
||||
Reference in New Issue
Block a user