virtualx-engine/modules/gdscript/tests/scripts/parser/features/variable_declaration.gd
ZuBsPaCe 1d1aa7a02f GDScript: Removed spurious UNASSIGNED_VARIABLE warning for locals
Variable->assignment needs to be incremented when assigned a value.
Also fixed and improved unit test 'variable_declaration.gd'.
Fixes #52551
2021-09-10 22:26:50 +02:00

19 lines
364 B
GDScript

var m1 # No init.
var m2 = 22 # Init.
var m3: String # No init, typed.
var m4: String = "44" # Init, typed.
func test():
var loc5 # No init, local.
var loc6 = 66 # Init, local.
var loc7: String # No init, typed.
var loc8: String = "88" # Init, typed.
m1 = 11
m3 = "33"
loc5 = 55
loc7 = "77"
prints(m1, m2, m3, m4, loc5, loc6, loc7, loc8)
print("OK")