Support array += without array size variable
Submitted by shuerhaaken
Link to original bug (#570821)
Description
Please describe the problem: In the testcase I get an error (from ccode) if the string array is public. If it is private, then it compiles. It looks like vala tries to take the size of the array from the class that contains the array.
Steps to reproduce: Testcase:
using GLib;
public class TestKlass : GLib.Object {
public string[] ar;
public void test_it() {
ar = new string[0];
ar += "hello";
}
public static int main(string[] args) {
TestKlass ff = new TestKlass();
ff.test_it();
return 0;
}
}
refarraytest.c: In Funktion »test_klass_test_it«:
refarraytest.c:33: Fehler: »TestKlass« hat kein Element namens »ar_size«
error: cc exited with status 256
Compilation failed: 1 error(s), 0 warning(s)
Actual results:
Expected results:
Does this happen every time?
Other information: Vala 0.5.6
Version: 0.9.x
Edited by Rico Tzschichholz