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 609388 - Vala does not allow elements of plain arrays as out parameters
Vala does not allow elements of plain arrays as out parameters
Status: RESOLVED FIXED
Product: vala
Classification: Core
Component: Arrays
0.7.x
Other All
: Normal normal
: ---
Assigned To: Vala maintainers
Vala maintainers
Depends on:
Blocks:
 
 
Reported: 2010-02-09 08:50 UTC by Sandino Flores-Moreno
Modified: 2010-02-10 10:02 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Sandino Flores-Moreno 2010-02-09 08:50:22 UTC
Vala fails to compile the next test case:

[test.vala]

void modify(out int n) {
        n = 5;
}

void main() {
        int[] a = new int[3];
        for(int i=0; i<a.length; i++)
                modify(out a[i]);
}

[/test.vala]


$ valac test.vala 
test.vala:8.10-8.17: error: ref and out method arguments can only be used with fields, parameters, and local variables
		modify(out a[i]);
		       ^^^^^^^^
Compilation failed: 1 error(s), 0 warning(s)
Comment 1 Jürg Billeter 2010-02-10 10:02:22 UTC
commit b7a5be2f5a2b1d2c4ab03d6e74251f41c53ce893
Author: Jürg Billeter <j@bitron.ch>
Date:   Wed Feb 10 10:59:51 2010 +0100

    Allow using array element access as ref and out method arguments
    
    Fixes bug 609388.