summaryrefslogtreecommitdiffstats
path: root/modules/gdscript/tests/scripts/runtime/features/reset_uninit_local_vars.gd
diff options
context:
space:
mode:
Diffstat (limited to 'modules/gdscript/tests/scripts/runtime/features/reset_uninit_local_vars.gd')
-rw-r--r--modules/gdscript/tests/scripts/runtime/features/reset_uninit_local_vars.gd21
1 files changed, 21 insertions, 0 deletions
diff --git a/modules/gdscript/tests/scripts/runtime/features/reset_uninit_local_vars.gd b/modules/gdscript/tests/scripts/runtime/features/reset_uninit_local_vars.gd
new file mode 100644
index 0000000000..b676ece24b
--- /dev/null
+++ b/modules/gdscript/tests/scripts/runtime/features/reset_uninit_local_vars.gd
@@ -0,0 +1,21 @@
+# GH-89958
+
+func test():
+ if true:
+ @warning_ignore("unused_variable")
+ var a = 1
+ @warning_ignore("unused_variable")
+ var b := 1
+ @warning_ignore("unused_variable")
+ var c := 1
+
+ if true:
+ @warning_ignore("unassigned_variable")
+ var a
+ print(a)
+ @warning_ignore("unassigned_variable")
+ var b
+ print(b)
+ @warning_ignore("unassigned_variable")
+ var c: Object
+ print(c)