use Moose::Meta::TypeConstraint::Parameterized;
use Moose::Util::TypeConstraints ();
+use Carp 'confess';
+
__PACKAGE__->meta->add_attribute('constraint_generator' => (
accessor => 'constraint_generator',
predicate => 'has_constraint_generator',
sub generate_inline_for {
my ($self, $type, $val) = @_;
- return unless $self->has_inline_generator;
+ confess "Can't generate an inline constraint for $type, since none "
+ . "was defined"
+ unless $self->has_inline_generator;
return $self->inline_generator->( $self, $type, $val );
}