virtualx-engine/modules/gdscript/tests/scripts/parser/warnings/unassigned_variable.out
George Marques 877802e252
GDScript: Don't warn on unassigned for builtin-typed variables
If the type of a variable is a built-in Variant type, then it will
automatically be assigned a default value based on the type. This means
that the explicit initialization may be unnecessary. Thus this commit
removes the warning in such case.

This also changes the meaning of the unassigned warning to happen when
the variable is used before being assigned, not when it has zero
assignments.
2024-04-10 11:59:57 -03:00

16 lines
355 B
Text

GDTEST_OK
>> WARNING
>> Line: 3
>> UNASSIGNED_VARIABLE
>> The variable "unassigned" was used before being assigned a value.
>> WARNING
>> Line: 7
>> UNASSIGNED_VARIABLE
>> The variable "a" was used before being assigned a value.
>> WARNING
>> Line: 8
>> UNASSIGNED_VARIABLE
>> The variable "a" was used before being assigned a value.
<null>
<null>
<null>