Subject: | Code in Synopsis does not work |
The `Lexical::Accessor` docs have this example in the synopsis:
my $accessor = lexical_has identifier => (
is => 'rw',
isa => Int,
default => sub { 0 },
);
# later...
say $self->$accessor;
To my surprise, it didn't work, because the return value of `lexical_has` actually was a reference to a coderef rather than a coderef. This GitHub pull request[1] fixes that by returning proper coderefs, and adds a few basic tests to ensure the proper coderef was returned.
[1]: https://github.com/tobyink/p5-lexical-accessor/pull/1