Subject: | JSON::RPC::Common::TypeConstraints generates warnings with Moose 0.79, and Perl 5.10 |
The warnings generated are:
WARNING: String found where Type expected (did you use a => instead of a
, ?) at
/usr/lib/perl5/vendor_perl/5.10.0/JSON/RPC/Common/TypeConstraints.pm line 10
WARNING: String found where Type expected (did you use a => instead of a
, ?) at
/usr/lib/perl5/vendor_perl/5.10.0/JSON/RPC/Common/TypeConstraints.pm line 12
WARNING: String found where Type expected (did you use a => instead of a
, ?) at
/usr/lib/perl5/vendor_perl/5.10.0/JSON/RPC/Common/TypeConstraints.pm line 14
I have attached a patch that removes the source of these warnings. The
patch also removes the "__PACKAGE__" line, to avoid an "Useless use of a
constant in void context" warning.
This bug probably exists under other combinations as well, but
JSON::RPC::Common 0.03, Moose 0.79, and Perl 5.10.0 is the only
combination that I have tested.
Subject: | fix-warnings.patch |
--- /usr/lib/perl5/vendor_perl/5.10.0/JSON/RPC/Common/TypeConstraints.pm 2009-05-27 00:51:46.000000000 -0700
+++ lib/JSON/RPC/Common/TypeConstraints.pm 2009-06-08 07:21:44.000000000 -0700
@@ -5,17 +5,31 @@
use strict;
use warnings;
-use MooseX::Types -declare => [qw(JSONDefined JSONValue JSONContainer)];
+use MooseX::Types
+ -declare => [qw(
+ JSONContainer
+ JSONDefined
+ JSONValue
+ )]
+;
+
+use MooseX::Types::Moose qw(
+ ArrayRef
+ HashRef
+ Undef
+ Value
+);
+
+subtype JSONDefined,
+ as Value|ArrayRef|HashRef;
-subtype JSONDefined, as "Value|ArrayRef|HashRef";
+subtype JSONValue,
+ as Undef|Value|ArrayRef|HashRef;
-subtype JSONValue, as 'Undef|Value|ArrayRef|HashRef';
+subtype JSONContainer,
+ as ArrayRef|HashRef;
-subtype JSONContainer, as 'ArrayRef|HashRef';
-
-__PACKAGE__
-
-__END__
+1;
=pod
@@ -50,5 +64,3 @@
=back
=cut
-
-