use warnings;
use MRO::Compat;
-use Scalar::Util 'blessed';
+use Scalar::Util qw/blessed weaken/;
use Carp 'confess';
sub new {
if (!exists($args{$key})) {
if ($attribute->has_default || $attribute->has_builder) {
- my $default = $attribute->default;
-
unless ($attribute->is_lazy) {
+ my $default = $attribute->default;
my $builder = $attribute->builder;
my $value = $attribute->has_builder
? $instance->$builder
$instance->{$key} = $value;
- Scalar::Util::weaken($instance->{$key})
+ weaken($instance->{$key})
if $attribute->weak_ref;
}
}
$instance->{$key} = $args{$key};
- Scalar::Util::weaken($instance->{$key})
+ weaken($instance->{$key})
if $attribute->weak_ref;
if ($attribute->has_trigger) {