From: Lukas Mai Date: Wed, 9 Oct 2013 21:09:58 +0000 (+0200) Subject: turn on type checks by default X-Git-Tag: v1.0401~1 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=e21fed2b5fdbb1ce75e3b7455f57b347cad02ec9;p=p5sagit%2FFunction-Parameters.git turn on type checks by default Rationale: Parsing types but ignoring them by default is stupid. --- diff --git a/lib/Function/Parameters.pm b/lib/Function/Parameters.pm index 0ceaeb7..d8e666a 100644 --- a/lib/Function/Parameters.pm +++ b/lib/Function/Parameters.pm @@ -149,7 +149,7 @@ sub import { $clean{invocant} = _delete_default \%type, 'invocant', 0; $clean{runtime} = _delete_default \%type, 'runtime', 0; $clean{check_argument_count} = _delete_default \%type, 'check_argument_count', 0; - $clean{check_argument_types} = _delete_default \%type, 'check_argument_types', 0; + $clean{check_argument_types} = _delete_default \%type, 'check_argument_types', 1; $clean{check_argument_count} = $clean{check_argument_types} = 1 if delete $type{strict}; if (my $rt = delete $type{reify_type}) { @@ -680,9 +680,11 @@ L|Carp>. =item C -Valid values: booleans. If turned on, functions defined with this keyword will -automatically check that the arguments they are passed pass the declared type -constraints (if any). See L below. +Valid values: booleans. This property is on by default; use +C<< check_argument_types => 0 >> to turn it off. This controls whether +functions defined with this keyword automatically check that the arguments they +are passed pass the declared type constraints (if any). See +L below. =item C