From: Tokuhiro Matsuno Date: Thu, 2 Apr 2009 02:45:11 +0000 (+0900) Subject: more strict argument check. Mouse does not support Application::ToInstance yet X-Git-Tag: 0.20~37 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=e0b163e1eae55efa02feae5a207b68b00734c124;p=gitmo%2FMouse.git more strict argument check. Mouse does not support Application::ToInstance yet --- diff --git a/lib/Mouse/Meta/Role.pm b/lib/Mouse/Meta/Role.pm index 6c5d32f..5dccbdc 100644 --- a/lib/Mouse/Meta/Role.pm +++ b/lib/Mouse/Meta/Role.pm @@ -70,6 +70,7 @@ sub get_method_list { wantarray ? @functions : \@functions; } +# Moose uses Application::ToInstance, Application::ToClass, Application::ToRole sub apply { my $self = shift; my $selfname = $self->name; @@ -77,6 +78,10 @@ sub apply { my $classname = $class->name; my %args = @_; + if ($class->isa('Mouse::Object')) { + Carp::croak('Mouse does not support Application::ToInstance yet'); + } + if ($class->isa('Mouse::Meta::Class')) { for my $name (@{$self->{required_methods}}) { unless ($classname->can($name)) {