diff --git a/lib/Type/Utils.pm b/lib/Type/Utils.pm index eb526dd12..145b06d10 100644 --- a/lib/Type/Utils.pm +++ b/lib/Type/Utils.pm @@ -30,9 +30,15 @@ our @EXPORT_OK = ( extends type subtype match_on_type compile_match_on_type dwim_type english_list - classifier is + classifier >, + "is", ); +our %EXPORT_TAGS = ( + default => \@EXPORT, + all => \@EXPORT_OK, +); +pop @{$EXPORT_TAGS{all}}; # remove 'is' require Exporter::Tiny; our @ISA = 'Exporter::Tiny'; @@ -1101,6 +1107,10 @@ Shortcut for C<< $type->check($value) >> but also if $type is a string, will look it up via C. This function is not exported by default. +This function is not even exported by C<< use Type::Utils -all >>. +You must request it explicitly. + + use Type::Utils "is"; Beware using this in test scripts because it has the same name as a function exported by L. Note that you can rename this function if diff --git a/t/20-unit/Type-Utils/warnings.t b/t/20-unit/Type-Utils/warnings.t index 26da22f1a..ad4884769 100644 --- a/t/20-unit/Type-Utils/warnings.t +++ b/t/20-unit/Type-Utils/warnings.t @@ -33,7 +33,7 @@ use Test::Requires { 'Test::Warnings' => 0.005 }; #warnings added in this versio use Test::Warnings qw( :no_end_test warnings ); use Type::Library -base, -declare => qw/WholeNumber/; -use Type::Utils qw/ -all !is /; +use Type::Utils -all; use Types::Standard qw/Int/; my @warnings = warnings { diff --git a/t/40-regression/rt92571.t b/t/40-regression/rt92571.t index 741c9779e..a4d68583f 100644 --- a/t/40-regression/rt92571.t +++ b/t/40-regression/rt92571.t @@ -30,7 +30,7 @@ use Test::More; use Type::Library -base, -declare => qw[ ArrayRefFromAny ]; use Types::Standard -all; -use Type::Utils qw( -all !is ); +use Type::Utils -all; declare_coercion ArrayRefFromAny, to_type ArrayRef,