Skip Menu |

This queue is for tickets about the Types-XSD-Lite CPAN distribution.

Report information
The Basics
Id: 94620
Status: resolved
Priority: 0/
Queue: Types-XSD-Lite

People
Owner: Nobody in particular
Requestors: djerius [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 0.003
Fixed in: (no value)



Subject: Moo breaks maxInclusive
Moo 1.004002 Types::XSD::Lite 0.003 I've attached a script which should cause a validation failure. If run as is, it doesn't load Moo, and it fails: % perl foo Value "10" did not pass type constraint "NonNegativeInteger[maxInclusive=>"9"]" (in $_[0]) at foo line 24 When run with the environment variable USE_MOO set, it loads Moo and has two bites at the rotten apple; neither fails: % USE_MOO=1 perl foo % So, loading Moo is doing something...
Subject: foo
Download foo
application/octet-stream 372b

Message body not shown because it is not plain text.

I forgot to note that it's just the maxInclusive part which is failing; changing the test value to -1 successfully fails (!) with and without Moo.
Confirmed. Seems to happen with Moose too.
If you want a temporary workaround, you can do this before parameterizing the type constraint. delete( NonNegativeInteger->{inline_generator} );
This is the fix... diff -r 8d9b585a7819 lib/Types/XSD/Lite.pm --- a/lib/Types/XSD/Lite.pm Mon Jul 08 16:50:19 2013 +0100 +++ b/lib/Types/XSD/Lite.pm Sat Apr 12 11:46:16 2014 +0100 @@ -298,9 +298,10 @@ my $inline_generator = sub { - my %p = @_; + my %p_not_destroyed = @_; return sub { local $T = $_[0]->parent; + my %p = %p_not_destroyed; # copy; my $var = $_[1]; my $r = sprintf( '(%s)',
Fixed in 0.004.