After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 645771 - Incorrect detection of unassign variables in do while loop
Incorrect detection of unassign variables in do while loop
Status: RESOLVED DUPLICATE of bug 574352
Product: vala
Classification: Core
Component: Semantic Analyzer
0.11.x
Other Linux
: Normal normal
: ---
Assigned To: Vala maintainers
Vala maintainers
Depends on:
Blocks:
 
 
Reported: 2011-03-26 19:05 UTC by Maciej (Matthew) Piechotka
Modified: 2011-04-30 10:58 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Maciej (Matthew) Piechotka 2011-03-26 19:05:26 UTC
public int f() {
	int i;
	do {
		i = 0;
	} while (i != 0);
	return i;
}


% valac test.vala
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)

Trivially in 5th line local variable is always assigned.
Comment 1 Colomban Wendling 2011-04-16 13:23:54 UTC
I can confirm this still allies to current Git master. Any plan to fix this one?
Comment 2 Maciej (Matthew) Piechotka 2011-04-30 10:58:59 UTC

*** This bug has been marked as a duplicate of bug 574352 ***