Revision history for MooseX-AlwaysCoerce
+ - support class_has with no isa (Karen Etheridge)
+
0.06 2010-07-28 00:58:50
- Use modern Moose APIs, to avoid warnings with Moose 1.09 (Karen Etheridge)
my $self = shift;
my ($what, %opts) = @_;
+ return unless exists $opts{isa};
+
my $type = Moose::Util::TypeConstraints::find_or_parse_type_constraint($opts{isa});
- $opts{coerce} = 1 if $type and not exists $opts{coerce} and $type->has_coercion;
+ $opts{coerce} = 1 if not exists $opts{coerce} and $type->has_coercion;
$self->$next($what, %opts);
};
has uncoerced_attr => (is => 'rw', isa => 'Uncoerced');
class_has uncoerced_class_attr => (is => 'rw', isa => 'Uncoerced');
+
+ class_has untyped_class_attr => (is => 'rw');
}
ok( (my $instance = MyClass->new), 'instance' );