diff options
author | George Marques <george@gmarqu.es> | 2021-09-13 09:09:58 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-13 09:09:58 -0300 |
commit | 64da50c88a8b9e8c8f67bd473cb4f68734003c79 (patch) | |
tree | a918d2153e6604833ba40ee9181f3d84cb4da01e /modules/gdscript/tests/scripts/parser/features/variable_declaration.gd | |
parent | 1994525fc285f903e8603ea5403c6062c112ce7d (diff) | |
parent | 1d1aa7a02fc64286a0c81cfb40fbf16f704d017e (diff) | |
download | redot-engine-64da50c88a8b9e8c8f67bd473cb4f68734003c79.tar.gz |
Merge pull request #52553 from ZuBsPaCe/gdscript-spurious-unassigned-variable-warning
GDScript: Removed spurious UNASSIGNED_VARIABLE warning for locals
Diffstat (limited to 'modules/gdscript/tests/scripts/parser/features/variable_declaration.gd')
-rw-r--r-- | modules/gdscript/tests/scripts/parser/features/variable_declaration.gd | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/modules/gdscript/tests/scripts/parser/features/variable_declaration.gd b/modules/gdscript/tests/scripts/parser/features/variable_declaration.gd index 3b48f10ca7..38567d35c6 100644 --- a/modules/gdscript/tests/scripts/parser/features/variable_declaration.gd +++ b/modules/gdscript/tests/scripts/parser/features/variable_declaration.gd @@ -1,12 +1,19 @@ -var a # No init. -var b = 42 # Init. +var m1 # No init. +var m2 = 22 # Init. +var m3: String # No init, typed. +var m4: String = "44" # Init, typed. func test(): - var c # No init, local. - var d = 23 # Init, local. + var loc5 # No init, local. + var loc6 = 66 # Init, local. + var loc7: String # No init, typed. + var loc8: String = "88" # Init, typed. - a = 1 - c = 2 + m1 = 11 + m3 = "33" - prints(a, b, c, d) + loc5 = 55 + loc7 = "77" + + prints(m1, m2, m3, m4, loc5, loc6, loc7, loc8) print("OK") |