From: Dagfinn Ilmari Mannsåker Date: Wed, 27 Mar 2013 18:50:01 +0000 (+0000) Subject: document Moose type constraint creation for roles and classes X-Git-Tag: v1.002000~36 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=9a3fc505bf4bf30c884fccc5fdac9d85508d28fd;p=gitmo%2FMoo.git document Moose type constraint creation for roles and classes It was actually fixed in 1.001000, but I forgot to add documentation and Changes entry. --- diff --git a/Changes b/Changes index 8b29723..f1bb399 100644 --- a/Changes +++ b/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. diff --git a/lib/Moo.pm b/lib/Moo.pm index 3711a68..2904243 100644 --- a/lib/Moo.pm +++ b/lib/Moo.pm @@ -281,6 +281,10 @@ metaclasses for your L and L packages, so you should be able to use them in L code without anybody ever noticing you aren't using L everywhere. +L will also create L for +classes and roles, so that C<< isa => 'MyClass' >> and C<< isa => 'MyRole' >> +work the same as for L classes and roles. + Extending a L class or consuming a L will also work. So will extending a L class or consuming a L - but note @@ -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 Since L does B run the C check before C if a coercion