mirror of
https://github.com/godotengine/godot.git
synced 2026-01-03 18:11:19 +03:00
GDScript: Add static typing for for loop variable
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
func test():
|
||||
var a: Array = [Resource.new()]
|
||||
for node: Node in a:
|
||||
print(node)
|
||||
@@ -0,0 +1,6 @@
|
||||
GDTEST_RUNTIME_ERROR
|
||||
>> SCRIPT ERROR
|
||||
>> on function: test()
|
||||
>> runtime/errors/for_loop_iterator_type_not_match_specified.gd
|
||||
>> 3
|
||||
>> Trying to assign value of type 'Resource' to a variable of type 'Node'.
|
||||
Reference in New Issue
Block a user