summaryrefslogtreecommitdiff
path: root/modules/gdscript/tests/scripts/analyzer/errors
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2023-02-07 14:07:53 +0100
committerRémi Verschelde <rverschelde@gmail.com>2023-02-07 14:07:53 +0100
commit5386289ee2d7af990030f3d2a3c06d8b530cb05a (patch)
tree017c1133bfb64e83bc8bac73d7251868dfc8a47a /modules/gdscript/tests/scripts/analyzer/errors
parentf5a0e18015f3b7a61cb8271912c22efb8642a72e (diff)
parent0fef203b1f39c3373f9f25b8e75e75f6b03f7c88 (diff)
Merge pull request #72144 from adamscott/fix-super-class-check
Remove script class checks when getting function signature
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