if (is_stack_unwinding_to_break(request->stack)) return UNLANG_ACTION_CALCULATE_RESULT;
+ vp = fr_dcursor_current(&state->cursor);
+ fr_assert(vp != NULL);
+
+ if (!fr_type_is_structural(vp->vp_type) && (vp->vp_type == state->key->vp_type)) {
+ fr_value_box_clear_value(&vp->data);
+ (void) fr_value_box_copy(vp, &vp->data, &state->key->data);
+ }
+
next:
vp = fr_dcursor_next(&state->cursor);
if (!vp) {
--- /dev/null
+#
+# PRE: foreach
+#
+
+&Tmp-Integer-0 := { 1, 3, 5, 11 }
+
+foreach uint32 self (&Tmp-Integer-0) {
+ &self += 19
+}
+
+if (&Tmp-Integer-0[0] != 20) {
+ test_fail
+}
+
+if (&Tmp-Integer-0[1] != 22) {
+ test_fail
+}
+
+if (&Tmp-Integer-0[2] != 24) {
+ test_fail
+}
+
+if (&Tmp-Integer-0[3] != 30) {
+ test_fail
+}
+
+success