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 601350 - variable initialization on for loop
variable initialization on for loop
Status: RESOLVED FIXED
Product: vala
Classification: Core
Component: Parser
0.7.x
Other All
: Normal normal
: ---
Assigned To: Vala maintainers
Vala maintainers
Depends on:
Blocks:
 
 
Reported: 2009-11-10 00:53 UTC by ccadete
Modified: 2010-01-09 11:35 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description ccadete 2009-11-10 00:53:41 UTC
The program:

void main(string[] args){

	for ( int i = 0, j = 4; i < 10; i++){
		stdout.printf("Hello");
	}
	
	stdout.printf("Hello");
}


initializes two variables in for loop, but vala gives the error:

error: syntax error, expected `;'
	for ( int i = 0, j = 4; i < 10; i++){
	               ^
Comment 1 Jürg Billeter 2010-01-09 11:35:53 UTC
commit 02fb161cb286a82ae1d7dc983067b0052c2ad05b
Author: Jürg Billeter <j@bitron.ch>
Date:   Sat Jan 9 12:34:53 2010 +0100

    Support multiple variable declarators in for initializer
    
    Fixes bug 601350.