my $self = shift;
my ($attr, $idx) = @_;
- return $attr->_inline_set_value(
- '$instance', '$params->{\'' . $attr->init_arg . '\'}'
- ),
+ my @initial_value = $attr->_inline_set_value(
+ '$instance', '$params->{\'' . $attr->init_arg . '\'}',
+ );
+
+ push @initial_value, (
+ '$attrs->[' . $idx . ']->set_initial_value(',
+ '$instance,',
+ $attr->_inline_instance_get('$instance'),
+ ');',
+ ) if $attr->has_initializer;
+
+ return @initial_value;
}
sub _inline_init_attr_from_default {
my $default = $self->_inline_default_value($attr, $idx);
return unless $default;
- return $attr->_inline_set_value('$instance', $default);
+ my @initial_value = $attr->_inline_set_value('$instance', $default);
+
+ push @initial_value, (
+ '$attrs->[' . $idx . ']->set_initial_value(',
+ '$instance,',
+ $attr->_inline_instance_get('$instance'),
+ ');',
+ ) if $attr->has_initializer;
+
+ return @initial_value;
}
sub _inline_default_value {