Skip to content

Commit

Permalink
document Moose type constraint creation for roles and classes
Browse files Browse the repository at this point in the history
It was actually fixed in 1.001000, but I forgot to add documentation and
Changes entry.
  • Loading branch information
ilmari committed Mar 27, 2013
1 parent 917f27c commit 9a3fc50
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Changes
@@ -1,3 +1,6 @@
- document Moose type constraint creation for roles and classes
(actually fixed in 1.001000)

1.001000 - 2013-03-16
- has will refuse to overwrite locally defined subs with generated
accessors.
Expand Down
7 changes: 7 additions & 0 deletions lib/Moo.pm
Expand Up @@ -281,6 +281,10 @@ metaclasses for your L<Moo> and L<Moo::Role> packages, so you should be able
to use them in L<Moose> code without anybody ever noticing you aren't using
L<Moose> everywhere.
L<Moo> will also create L<Moose type constraints|Moose::Manual::Types> for
classes and roles, so that C<< isa => 'MyClass' >> and C<< isa => 'MyRole' >>
work the same as for L<Moose> classes and roles.
Extending a L<Moose> class or consuming a L<Moose::Role> will also work.
So will extending a L<Mouse> class or consuming a L<Mouse::Role> - but note
Expand Down Expand Up @@ -467,6 +471,9 @@ one should do
die "$_[0] is not a number!" unless looks_like_number $_[0]
},
Note that the return value is ignored, only whether the sub lives or
dies matters.
L<Sub::Quote aware|/SUB QUOTE AWARE>
Since L<Moo> does B<not> run the C<isa> check before C<coerce> if a coercion
Expand Down

0 comments on commit 9a3fc50

Please sign in to comment.