[libtype-tiny-perl] 09/11: Int is supposed to be a subtype of Str, and thus not a reference

Jonas Smedegaard dr at jones.dk
Wed Oct 29 19:42:48 UTC 2014


This is an automated email from the git hooks/post-receive script.

js pushed a commit to tag 1.001_002
in repository libtype-tiny-perl.

commit adc819ea72a9bcd8eca7c8d7fe66a82f40145c70
Author: Toby Inkster <mail at tobyinkster.co.uk>
Date:   Sat Oct 25 21:03:24 2014 +0100

    Int is supposed to be a subtype of Str, and thus not a reference
---
 lib/Types/Standard.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/Types/Standard.pm b/lib/Types/Standard.pm
index a802eb0..211d8fd 100644
--- a/lib/Types/Standard.pm
+++ b/lib/Types/Standard.pm
@@ -216,7 +216,7 @@ $meta->$add_core_type({
 	name       => "Int",
 	parent     => $_num,
 	constraint => sub { /\A-?[0-9]+\z/ },
-	inlined    => sub { "defined $_[1] and $_[1] =~ /\\A-?[0-9]+\\z/" },
+	inlined    => sub { "defined($_[1]) and !ref($_[1]) and $_[1] =~ /\\A-?[0-9]+\\z/" },
 });
 
 my $_classn = $meta->add_type({

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libtype-tiny-perl.git



More information about the Pkg-perl-cvs-commits mailing list