[Vala] [Bug?] Curious code generation for constructor



I have the following Vala code:

============
public class Process : GLib.Object {
        public string[] argv {
                get; construct;
        }

        public Process(string[] args) {
                this.argv = args;
        }
}

public class EntryPoint {
        public static int main(string[] args) {
                Process p = new Process(new string[] { "/usr/bin/env",
                                                       "xterm" });
                return(0);
        }
}
============

Now, I thought this was valid code, but I'd appear to be wrong.  When I
compile this, I get two CRITICAL messages and errors from the C
compiler:

mbt zest:~/test/programming/vala$ valac codegen-fail-construct.vala 
codegen-fail-construct.vala:13.11-14.24: warning: local variable `p'
declared but never used

============
** (valac:9906): CRITICAL **: vala_ccode_identifier_construct:
assertion `_name != NULL' failed

** (valac:9906): CRITICAL **: vala_ccode_function_call_add_argument:
assertion `expr != NULL' failed
codegen-fail-construct.c: In function ‘process_construct’:
codegen-fail-construct.c:39: error: too few arguments to function
‘g_value_init’
codegen-fail-construct.c: In function ‘process_set_argv’:
codegen-fail-construct.c:83: error: ‘value_length1’ undeclared (first
use in this function)
codegen-fail-construct.c:83: error: (Each undeclared identifier is
reported only once
codegen-fail-construct.c:83: error: for each function it appears in.)
error: cc exited with status 256
Compilation failed: 1 error(s), 1 warning(s)
============

So, my questions are:

  #1. What am I doing wrong that Vala isn't telling me I am doing
      wrong?
  #2. Should I file a bug report against Vala for the missing
      diagnostic, whatever that missing diagnostic might be?

Thanks!

        --- Mike





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