summaryrefslogtreecommitdiff
path: root/modules/gdscript/tests/scripts/parser
diff options
context:
space:
mode:
authorRémi Verschelde <remi@verschelde.fr>2021-11-23 15:15:36 +0100
committerGitHub <noreply@github.com>2021-11-23 15:15:36 +0100
commit3ba2d17d2f4b5d1b41c7b00f1020100f9efcc1b6 (patch)
tree0791661409e1b775d79aa19fa9986cad0f600a35 /modules/gdscript/tests/scripts/parser
parent0cec0d35170695d7c8b803c67cb7266276ab886c (diff)
parent3396b254891db02edb29950e7a2a1c1968612949 (diff)
Merge pull request #54949 from Chaosus/fix_warning
Diffstat (limited to 'modules/gdscript/tests/scripts/parser')
-rw-r--r--modules/gdscript/tests/scripts/parser/warnings/shadowed_global_identifier.gd2
-rw-r--r--modules/gdscript/tests/scripts/parser/warnings/shadowed_global_identifier.out9
2 files changed, 11 insertions, 0 deletions
diff --git a/modules/gdscript/tests/scripts/parser/warnings/shadowed_global_identifier.gd b/modules/gdscript/tests/scripts/parser/warnings/shadowed_global_identifier.gd
new file mode 100644
index 0000000000..3c64be571b
--- /dev/null
+++ b/modules/gdscript/tests/scripts/parser/warnings/shadowed_global_identifier.gd
@@ -0,0 +1,2 @@
+func test():
+ var abs = "This variable has the same name as the built-in function."
diff --git a/modules/gdscript/tests/scripts/parser/warnings/shadowed_global_identifier.out b/modules/gdscript/tests/scripts/parser/warnings/shadowed_global_identifier.out
new file mode 100644
index 0000000000..f2b29e5bad
--- /dev/null
+++ b/modules/gdscript/tests/scripts/parser/warnings/shadowed_global_identifier.out
@@ -0,0 +1,9 @@
+GDTEST_OK
+>> WARNING
+>> Line: 2
+>> SHADOWED_GLOBAL_IDENTIFIER
+>> The local variable 'abs' has the same name as a built-in function.
+>> WARNING
+>> Line: 2
+>> UNUSED_VARIABLE
+>> The local variable 'abs' is declared but never used in the block. If this is intended, prefix it with an underscore: '_abs'