X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FMooseX%2FDependent.pm;h=9ab310e744fb961584a677625b44edb20e9a5ca1;hb=6c67366ecd39381243976cb75765141882bef6bc;hp=e90e299cd58babae33b97701bdacfc3b7f6759de;hpb=72c6594c50c0d6253d079428c91062999cd8c1b4;p=gitmo%2FMooseX-Dependent.git diff --git a/lib/MooseX/Dependent.pm b/lib/MooseX/Dependent.pm index e90e299..9ab310e 100644 --- a/lib/MooseX/Dependent.pm +++ b/lib/MooseX/Dependent.pm @@ -45,8 +45,9 @@ You can then use this $set_obj as a parameter on the previously declared type constraint 'UniqueID'. This $set_obj become part of the constraint (you can't actually use the constraint without it.) - UniqueID[$set_obj]->check(1); ## Not OK, since one isn't unique in $set_obj - UniqueID[$set_obj]->check(100); ## OK, since 100 isn't in the set. + UniqueID([$set_obj])->check(1); ## Not OK, since one isn't unique in $set_obj + UniqueID([$set_obj])->check('AAA'); ## Not OK, since AAA is not an Int + UniqueID([$set_obj])->check(100); ## OK, since 100 isn't in the set. You can assign the result of a parameterized dependent type to a variable or to another type constraint, as like any other type constraint: