These where missing when generating postconditions
Fixes bug 737222
} else {
result.cvalue = new CCodeIdentifier ("result");
}
+ if (array_type != null && !array_type.fixed_length && ((current_method != null && get_ccode_array_length (current_method)) || current_property_accessor != null)) {
+ for (int dim = 1; dim <= array_type.rank; dim++) {
+ result.append_array_length_cvalue (new CCodeUnaryExpression (CCodeUnaryOperator.POINTER_INDIRECTION, get_variable_cexpression (get_array_length_cname ("result", dim))));
+ }
+ }
} else if (local.captured) {
// captured variables are stored on the heap
var block = (Block) local.parent_symbol;
methods/bug723195.vala \
methods/bug726347.vala \
methods/bug736235.vala \
+ methods/bug737222.vala \
methods/generics.vala \
control-flow/break.vala \
control-flow/expressions-conditional.vala \
--- /dev/null
+int[] foo () ensures (result.length == 0 || result.length == 1) {
+ return new int[1];
+}
+
+[CCode (array_length = false, array_null_terminated = true)]
+string[] bar () ensures (result[0] == "bar") {
+ return new string[] {"bar"};
+}
+
+void main () {
+ foo ();
+ bar ();
+}