Debian Codegraph @

modules/gdscript/tests/scripts/analyzer/features/allow_get_node_with_onready.gd

raw
1 extends Node
2
3 @onready var shorthand = $Node
4 @onready var call_no_cast = get_node(^"Node")
5 @onready var shorthand_with_cast = $Node as Node
6 @onready var call_with_cast = get_node(^"Node") as Node
7
8 func _init():
9 var node := Node.new()
10 node.name = "Node"
11 add_child(node)
12
13 func test():
14 # Those are expected to be `null` since `_ready()` is never called on tests.
15 prints("shorthand", shorthand)
16 prints("call_no_cast", call_no_cast)
17 prints("shorthand_with_cast", shorthand_with_cast)
18 prints("call_with_cast", call_with_cast)