cfile.add_include ("stdarg.h");
}
- if (!(m is CreationMethod)) {
+ if (!(m is CreationMethod) || m.parent_symbol is Struct) {
ccode.add_declaration ("va_list", new CCodeVariableDeclarator ("_va_list_%s".printf (get_ccode_name (local))));
var vastart = new CCodeFunctionCall (new CCodeIdentifier ("va_start"));
vastart.add_argument (new CCodeIdentifier ("_va_list_%s".printf (get_ccode_name (local))));
structs/struct-static-field-initializer.test \
structs/struct-static-property-initializer.test \
structs/structs.vala \
+ structs/constructor-params-array.vala \
structs/constructor-variadic.vala \
structs/constructor-wrong-name.test \
structs/default-gtype.vala \
--- /dev/null
+struct Foo {
+ public string[] sa;
+
+ public Foo (params string[] strv) {
+ assert (strv.length == 3);
+ assert (strv[0] == "foo");
+ assert (strv[1] == "bar");
+ assert (strv[2] == "manam");
+ sa = strv;
+ }
+}
+
+void main () {
+ var foo = Foo ("foo", "bar", "manam");
+ assert (foo.sa[1] == "bar");
+}