make native trait inlining work
[gitmo/Moose.git] / lib / Moose / Meta / Method / Accessor / Native / Hash.pm
1 package Moose::Meta::Method::Accessor::Native::Hash;
2
3 use strict;
4 use warnings;
5
6 our $VERSION = '1.19';
7 $VERSION = eval $VERSION;
8 our $AUTHORITY = 'cpan:STEVAN';
9
10 use Moose::Role;
11
12 sub _inline_check_var_is_valid_key {
13     my $self = shift;
14     my ($var) = @_;
15
16     return (
17         'if (!defined(' . $var . ')) {',
18             $self->_inline_throw_error(
19                 '"The key passed to '
20               . $self->delegate_to_method
21               . ' must be a defined value"',
22             ) . ';',
23         '}',
24     );
25 }
26
27 no Moose::Role;
28
29 1;