From: Jesse Luehrs Date: Fri, 26 Jun 2009 03:26:48 +0000 (-0500) Subject: make has in roles set definition_context X-Git-Tag: 0.84~9 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=c934663bd34790250b3e242b2e1003bde0e7054c;p=gitmo%2FMoose.git make has in roles set definition_context --- diff --git a/lib/Moose/Role.pm b/lib/Moose/Role.pm index d7e71d5..d042ae4 100644 --- a/lib/Moose/Role.pm +++ b/lib/Moose/Role.pm @@ -41,7 +41,7 @@ sub has { my $meta = Moose::Meta::Role->initialize(shift); my $name = shift; croak 'Usage: has \'name\' => ( key => value, ... )' if @_ == 1; - my %options = @_; + my %options = ( definition_context => Moose::_caller_info(), @_ ); my $attrs = ( ref($name) eq 'ARRAY' ) ? $name : [ ($name) ]; $meta->add_attribute( $_, %options ) for @$attrs; }