Fix dyn_index dispatch to sub-components in Rust

Correctly make the dyn_index a local index by subtracting the base
This commit is contained in:
Simon Hausmann 2021-11-09 10:46:48 +01:00
parent f7415171d0
commit b0d76d1bcc

View file

@ -624,7 +624,7 @@ fn generate_component(
let last_repeater: usize = repeater_count + sub_component_repeater_count - 1;
self.repeated_visit_branch.push(quote!(
#repeater_count..=#last_repeater => {
#field.apply_pin(_self).visit_dynamic_children(dyn_index, order, visitor)
#field.apply_pin(_self).visit_dynamic_children(dyn_index - #repeater_count, order, visitor)
}
));
}