It is required to have a fixed length like "type array[3]".
Fixes https://gitlab.gnome.org/GNOME/vala/issues/163
basic-types/bug604589.test \
basic-types/bug622178.vala \
basic-types/bug632322.vala \
+ basic-types/bug641308.test \
basic-types/bug643612.vala \
basic-types/bug644046.vala \
basic-types/bug647222.vala \
--- /dev/null
+Invalid Code
+
+void foo (int i[]) {
+}
+
+void main () {
+}
}
string id = parse_identifier ();
- type = parse_inline_array_type (type);
+ var array_type = parse_inline_array_type (type);
+ if (!(type is ArrayType) && (array_type is ArrayType) && !((ArrayType) array_type).fixed_length) {
+ throw new ParseError.SYNTAX ("invalid array parameter declaration");
+ } else {
+ type = array_type;
+ }
var param = new Parameter (id, type, get_src (begin));
set_attributes (param, attrs);