Re: [Vala] Static array initialization



On Fre, 2007-03-09 at 01:05 +0100, Jürg Billeter wrote:
On Don, 2007-03-08 at 17:48 -0600, Cayle Graumann wrote:
Speaking of array initialization - I came across an oddity the other
day in version 0.0.6 in that the following syntax would not compile.
I have not tried it with 0.0.7 yet as I am still trying to change over
my code to the new constructor syntax to test other things yet.

function x (int buffersize) {

      int[] i;
      if(buffersize>10) {
             i = new int[100];
      } else {
             i = new int[10];
      }

}

The vala compiler complained about the "int[] i" not being valid.

That's a known bug in the parser, we have to refactor it a bit to get
that working. We'll hopefully fix that for 0.0.8.

Fixed in SVN, at least for the simple one-dimensional case.

Jürg




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]