mirror of
https://github.com/godotengine/godot.git
synced 2026-01-03 18:11:19 +03:00
GDScript: Don't allow @onready without inheriting Node
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
extends RefCounted
|
||||
|
||||
func test():
|
||||
var nope := $Node
|
||||
print("Cannot use $ without a Node base")
|
||||
@@ -0,0 +1,2 @@
|
||||
GDTEST_ANALYZER_ERROR
|
||||
Cannot use shorthand "get_node()" notation ("$") on a class that isn't a node.
|
||||
@@ -0,0 +1,6 @@
|
||||
extends RefCounted
|
||||
|
||||
@onready var nope := 0
|
||||
|
||||
func test():
|
||||
print("Cannot use @onready without a Node base")
|
||||
@@ -0,0 +1,2 @@
|
||||
GDTEST_ANALYZER_ERROR
|
||||
"@onready" can only be used in classes that inherit "Node".
|
||||
Reference in New Issue
Block a user