summaryrefslogtreecommitdiff
path: root/lib/Type/Tiny/Class.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Type/Tiny/Class.pm')
-rw-r--r--lib/Type/Tiny/Class.pm11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/Type/Tiny/Class.pm b/lib/Type/Tiny/Class.pm
index 5a860fec..6c921538 100644
--- a/lib/Type/Tiny/Class.pm
+++ b/lib/Type/Tiny/Class.pm
@@ -60,6 +60,17 @@ sub _build_message
return sub { sprintf 'value "%s" did not pass type constraint "%s" (not isa %s)', $_[0], $name, $c };
}
+sub _instantiate_moose_type
+{
+ my $self = shift;
+ my %opts = @_;
+ delete $opts{parent};
+ delete $opts{constraint};
+ delete $opts{inlined};
+ require Moose::Meta::TypeConstraint::Class;
+ return "Moose::Meta::TypeConstraint::Class"->new(%opts, class => $self->class);
+}
+
1;
__END__