summaryrefslogtreecommitdiffstats
path: root/modules/gdscript/tests/scripts/analyzer/errors
diff options
context:
space:
mode:
authorYuri Sizov <yuris@humnom.net>2023-09-27 19:07:46 +0200
committerYuri Sizov <yuris@humnom.net>2023-09-27 19:07:46 +0200
commitaa474c9feb489576de38240e2d9e87f7dbd65e28 (patch)
tree33c6404fbdf43cc27644449b5782c84fa8f85fd4 /modules/gdscript/tests/scripts/analyzer/errors
parentec62b8a3ee1d731387a440b4d2abb7961aa28322 (diff)
parente8696f9961e4d317f56ceb9626792529966f0e91 (diff)
downloadredot-engine-aa474c9feb489576de38240e2d9e87f7dbd65e28.tar.gz
Merge pull request #75988 from dalexeev/gds-unsafe-call-argument
GDScript: Improve call analysis
Diffstat (limited to 'modules/gdscript/tests/scripts/analyzer/errors')
-rw-r--r--modules/gdscript/tests/scripts/analyzer/errors/call_not_existing_static_method.gd7
-rw-r--r--modules/gdscript/tests/scripts/analyzer/errors/call_not_existing_static_method.out2
-rw-r--r--modules/gdscript/tests/scripts/analyzer/errors/object_invalid_constructor.gd4
-rw-r--r--modules/gdscript/tests/scripts/analyzer/errors/object_invalid_constructor.out2
4 files changed, 15 insertions, 0 deletions
diff --git a/modules/gdscript/tests/scripts/analyzer/errors/call_not_existing_static_method.gd b/modules/gdscript/tests/scripts/analyzer/errors/call_not_existing_static_method.gd
new file mode 100644
index 0000000000..87d1b9ea18
--- /dev/null
+++ b/modules/gdscript/tests/scripts/analyzer/errors/call_not_existing_static_method.gd
@@ -0,0 +1,7 @@
+# GH-73283
+
+class MyClass:
+ pass
+
+func test():
+ MyClass.not_existing_method()
diff --git a/modules/gdscript/tests/scripts/analyzer/errors/call_not_existing_static_method.out b/modules/gdscript/tests/scripts/analyzer/errors/call_not_existing_static_method.out
new file mode 100644
index 0000000000..7340058dd4
--- /dev/null
+++ b/modules/gdscript/tests/scripts/analyzer/errors/call_not_existing_static_method.out
@@ -0,0 +1,2 @@
+GDTEST_ANALYZER_ERROR
+Static function "not_existing_method()" not found in base "MyClass".
diff --git a/modules/gdscript/tests/scripts/analyzer/errors/object_invalid_constructor.gd b/modules/gdscript/tests/scripts/analyzer/errors/object_invalid_constructor.gd
new file mode 100644
index 0000000000..1600c3001f
--- /dev/null
+++ b/modules/gdscript/tests/scripts/analyzer/errors/object_invalid_constructor.gd
@@ -0,0 +1,4 @@
+# GH-73213
+
+func test():
+ print(Object())
diff --git a/modules/gdscript/tests/scripts/analyzer/errors/object_invalid_constructor.out b/modules/gdscript/tests/scripts/analyzer/errors/object_invalid_constructor.out
new file mode 100644
index 0000000000..27668fcd48
--- /dev/null
+++ b/modules/gdscript/tests/scripts/analyzer/errors/object_invalid_constructor.out
@@ -0,0 +1,2 @@
+GDTEST_ANALYZER_ERROR
+Invalid constructor "Object()", use "Object.new()" instead.