Variable initialized in do-while loop not recognized
Submitted by rai..@..il.com
Link to original bug (#574352)
Description
Please describe the problem: If a variable is initialized in a do-while loop iteration (which is guaranteed to be executed at least once), the symantic analyzer still complains the variable is not initialized.
void main () {
int i;
do {
i = 0;
} while (i != 0);
}
test.vala:5.11-5.16: error: use of possibly unassigned local variable `i'
} while (i != 0);
^^^^^^
Compilation failed: 1 error(s), 0 warning(s)
Other information: the work around is to set variable when define it. But this would be a duplication of work since it is going to be initizized in the do-while loop.
Version: 0.22.x
Edited by Rico Tzschichholz