diff options
author | Danil Alexeev <danil@alexeev.xyz> | 2023-06-22 12:19:14 +0300 |
---|---|---|
committer | Danil Alexeev <danil@alexeev.xyz> | 2023-08-09 17:11:38 +0300 |
commit | 0f27c4ad8079f58d7c6cc86d644a89a78b6e8c79 (patch) | |
tree | cb728b6722c6db950275bb34b77cd5e7007c5f80 /modules/gdscript/tests | |
parent | 11ea4dc46647693eb41179b641b3c4f261b4fef4 (diff) | |
download | redot-engine-0f27c4ad8079f58d7c6cc86d644a89a78b6e8c79.tar.gz |
GDScript: Check `get_node()` shorthand in static functions
Diffstat (limited to 'modules/gdscript/tests')
-rw-r--r-- | modules/gdscript/tests/scripts/analyzer/errors/get_node_shorthand_in_static_function.gd | 9 | ||||
-rw-r--r-- | modules/gdscript/tests/scripts/analyzer/errors/get_node_shorthand_in_static_function.out | 2 |
2 files changed, 11 insertions, 0 deletions
diff --git a/modules/gdscript/tests/scripts/analyzer/errors/get_node_shorthand_in_static_function.gd b/modules/gdscript/tests/scripts/analyzer/errors/get_node_shorthand_in_static_function.gd new file mode 100644 index 0000000000..caeea46977 --- /dev/null +++ b/modules/gdscript/tests/scripts/analyzer/errors/get_node_shorthand_in_static_function.gd @@ -0,0 +1,9 @@ +# GH-75645 + +extends Node + +static func static_func(): + var a = $Node + +func test(): + pass diff --git a/modules/gdscript/tests/scripts/analyzer/errors/get_node_shorthand_in_static_function.out b/modules/gdscript/tests/scripts/analyzer/errors/get_node_shorthand_in_static_function.out new file mode 100644 index 0000000000..1910b3e66b --- /dev/null +++ b/modules/gdscript/tests/scripts/analyzer/errors/get_node_shorthand_in_static_function.out @@ -0,0 +1,2 @@ +GDTEST_ANALYZER_ERROR +Cannot use shorthand "get_node()" notation ("$") in a static function. |