Hi all
I use valac version 0.24.0.
When I use operator "+=" with a class that has sugar syntax support for
operator "[]" the compiler produces wrong C code.
Example:

using Gee;
void main()
{
    ArrayList<int> a = new ArrayList<int>();
    a.add(2);
    print(@"a[0] = $(a[0])\n");
    a[0] = a[0] + 1;
    print(@"a[0] = $(a[0])\n");
    a[0] += 1;
    print(@"a[0] = $(a[0])\n");
}

This will output 2, 3, 1 instead of 2, 3, 4 as intended.

I do not know if it is fixed in more current valac versions.

--Luca
_______________________________________________
vala-list mailing list
[email protected]
https://mail.gnome.org/mailman/listinfo/vala-list

Reply via email to