diff options
| author | Yuri Sizov <11782833+YuriSizov@users.noreply.github.com> | 2023-02-06 23:03:44 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-02-06 23:03:44 +0300 |
| commit | 7b86a082be918631c7024ba9a516bd3388e18995 (patch) | |
| tree | e1878b4fbb8f770d6d33379882623e2bd7a5c168 /modules/gdscript/tests/scripts/analyzer/errors | |
| parent | 9d16250353b4966c894fc1ad45c95425a0c3a659 (diff) | |
| parent | ed5ddab7e54c121726116e36604b062dc172a2d0 (diff) | |
Merge pull request #72804 from vnen/gdscript-no-onready-without-node
GDScript: Fix inheritance check of @onready for inner classes
Diffstat (limited to 'modules/gdscript/tests/scripts/analyzer/errors')
| -rw-r--r-- | modules/gdscript/tests/scripts/analyzer/errors/onready_within_non_node_inner_class.gd | 7 | ||||
| -rw-r--r-- | modules/gdscript/tests/scripts/analyzer/errors/onready_within_non_node_inner_class.out | 2 |
2 files changed, 9 insertions, 0 deletions
diff --git a/modules/gdscript/tests/scripts/analyzer/errors/onready_within_non_node_inner_class.gd b/modules/gdscript/tests/scripts/analyzer/errors/onready_within_non_node_inner_class.gd new file mode 100644 index 0000000000..1639bbbd52 --- /dev/null +++ b/modules/gdscript/tests/scripts/analyzer/errors/onready_within_non_node_inner_class.gd @@ -0,0 +1,7 @@ +extends Node + +class Inner extends RefCounted: + @onready var nope = 0 + +func test(): + print("Cannot use @onready without a Node base") diff --git a/modules/gdscript/tests/scripts/analyzer/errors/onready_within_non_node_inner_class.out b/modules/gdscript/tests/scripts/analyzer/errors/onready_within_non_node_inner_class.out new file mode 100644 index 0000000000..8088d28329 --- /dev/null +++ b/modules/gdscript/tests/scripts/analyzer/errors/onready_within_non_node_inner_class.out @@ -0,0 +1,2 @@ +GDTEST_ANALYZER_ERROR +"@onready" can only be used in classes that inherit "Node". |