Skip Menu |

This queue is for tickets about the Moose CPAN distribution.

Report information
The Basics
Id: 58411
Status: resolved
Priority: 0/
Queue: Moose

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

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



A coerced attribute of an union type with an Undef member fails to apply constraints. $ perl -Moose -le' has a=>(is=>"rw",isa=>"Undef|Undef",coerce=>1); __PACKAGE__->new(a=>"abc"); print "BAD"; ' BAD $ perl -Moose -e' has a=>(is=>"rw",isa=>"Undef",coerce=>1); __PACKAGE__->new(a=>"abc"); print "BAD"; ' Attribute (a) does not pass the type constraint because: Validation failed for 'Undef' failed with value abc at [snip backtrace] $ perl -Moose -e' has a=>(is=>"rw",isa=>"Num|Num",coerce=>1); __PACKAGE__->new(a=>"abc"); print "BAD"; ' Attribute (a) does not pass the type constraint because: Validation failed for 'Num|Num' failed with value undef at [snip backtrace] $ perl -Moose -e' has a=>(is=>"rw",isa=>"Undef|Undef",coerce=>0); __PACKAGE__->new(a=>"abc"); print "BAD"; ' Attribute (a) does not pass the type constraint because: Validation failed for 'Undef|Undef' failed with value abc at [snip backtrace]