summaryrefslogtreecommitdiff
path: root/modules/gdscript/tests/scripts/analyzer/errors
diff options
context:
space:
mode:
Diffstat (limited to 'modules/gdscript/tests/scripts/analyzer/errors')
-rw-r--r--modules/gdscript/tests/scripts/analyzer/errors/gdscript_duplicate.gd5
-rw-r--r--modules/gdscript/tests/scripts/analyzer/errors/gdscript_duplicate.out2
-rw-r--r--modules/gdscript/tests/scripts/analyzer/errors/gdscript_duplicate_class.notest.gd1
3 files changed, 8 insertions, 0 deletions
diff --git a/modules/gdscript/tests/scripts/analyzer/errors/gdscript_duplicate.gd b/modules/gdscript/tests/scripts/analyzer/errors/gdscript_duplicate.gd
new file mode 100644
index 0000000000..966d2b0aa2
--- /dev/null
+++ b/modules/gdscript/tests/scripts/analyzer/errors/gdscript_duplicate.gd
@@ -0,0 +1,5 @@
+const TestClass = preload("gdscript_duplicate_class.notest.gd")
+
+func test():
+ # (TestClass as GDScript).duplicate() exists
+ TestClass.duplicate()
diff --git a/modules/gdscript/tests/scripts/analyzer/errors/gdscript_duplicate.out b/modules/gdscript/tests/scripts/analyzer/errors/gdscript_duplicate.out
new file mode 100644
index 0000000000..b2c7fec86e
--- /dev/null
+++ b/modules/gdscript/tests/scripts/analyzer/errors/gdscript_duplicate.out
@@ -0,0 +1,2 @@
+GDTEST_ANALYZER_ERROR
+Cannot call non-static function "duplicate()" on a class directly. Make an instance instead.
diff --git a/modules/gdscript/tests/scripts/analyzer/errors/gdscript_duplicate_class.notest.gd b/modules/gdscript/tests/scripts/analyzer/errors/gdscript_duplicate_class.notest.gd
new file mode 100644
index 0000000000..61510e14cd
--- /dev/null
+++ b/modules/gdscript/tests/scripts/analyzer/errors/gdscript_duplicate_class.notest.gd
@@ -0,0 +1 @@
+extends Node