X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FMooseX%2FTypes%2FStructured.pm;h=ab543edaa1067c347d63a0161c489f907e6348ec;hb=a4a88fefad0246cc6b5eea44874bcfb2ff34253d;hp=a4c6be6f8e1edc0168095d275092b4d46adb8ccb;hpb=686da114e30aae8bf5b1e57ffdb18493f5305551;p=gitmo%2FMooseX-Types-Structured.git diff --git a/lib/MooseX/Types/Structured.pm b/lib/MooseX/Types/Structured.pm index a4c6be6..ab543ed 100644 --- a/lib/MooseX/Types/Structured.pm +++ b/lib/MooseX/Types/Structured.pm @@ -102,11 +102,21 @@ method, granting some interesting possibilities for coercion. Try: name=>$name, age=>$age->years ); }; - - -=head1 METHODS + +You also need to exercise some care when you try to structure a structured type +as in this example: -This class defines the following methods + subtype Person, + as Dict[name=>Str, age=>iIt]; + + subtype FriendlyPerson, + as Person[name=>Str, age=>Int, totalFriends=>Int]; + +This will actually work BUT you have to take care the the subtype has a +structure that does not contradict the structure of it's parent. For now the +above works, but I will probably clarify how this works at a future point, so +it's recommended to avoid (should not realy be needed so much anyway). For +now this is supported in an EXPERIMENTAL way. =cut