predicate=>'has_constraint_generator',
);
+has coercion => (
+ is => 'ro',
+ isa => 'Object',
+ builder => '_build_coercion',
+);
+
=head1 METHODS
This class defines the following methods.
=cut
-around 'new' => sub {
- my ($new, $class, @args) = @_;
- my $self = $class->$new(@args);
- $self->coercion(MooseX::Meta::TypeCoercion::Structured->new(
+sub _build_coercion {
+ my ($self) = @_;
+ return MooseX::Meta::TypeCoercion::Structured->new(
type_constraint => $self,
- ));
- return $self;
-};
+ );
+}
=head2 validate
my $other = Moose::Util::TypeConstraints::find_type_constraint($type_or_name);
if ( $other->isa(__PACKAGE__) and @{ $other->type_constraints || [] }) {
- warn "structured ( $self, $other )";
if ( $self->parent->is_a_type_of($other->parent) ) {
- warn "related ( $self, $other )";
return $self->_type_constraints_op_all($other, "is_a_type_of");
} elsif ( $self->parent->is_a_type_of($other) ) {
return 1;
=head2 type_constraints_equals
-Checks to see if the internal type contraints are equal.
+Checks to see if the internal type constraints are equal.
=cut
=cut
-__PACKAGE__->meta->make_immutable;
+__PACKAGE__->meta->make_immutable(inline_constructor => 0);