diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2024-04-24 18:54:56 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2024-04-24 18:54:56 +0200 |
commit | 69a23e64e4aa6543adba79c4d3767bf0d2728faa (patch) | |
tree | 82ff15f208bb594ce2ecea68212fea84df3c96a6 /modules/gdscript/tests/scripts/runtime/features/reset_uninit_local_vars.gd | |
parent | a4fbe4c01f5d4e47bd047b091a65fef9f7eb2cca (diff) | |
parent | 27d7760f41d0c819075db37d3234d2587092e682 (diff) | |
download | redot-engine-69a23e64e4aa6543adba79c4d3767bf0d2728faa.tar.gz |
Merge pull request #89990 from dalexeev/gds-reset-uninit-local-vars
GDScript: Fix uninitialized local variables not being reset
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.gd | 21 |
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) |