Skip Menu |

This queue is for tickets about the Moose CPAN distribution.

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

People
Owner: Nobody in particular
Requestors: bobtfish [...] bobtfish.net
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 1.19
Fixed in: 1.20



Subject: Native Array trait push method type constraint bug with class types
As per the attached test, if you have an ArrayRef[Class1] attribute, which you add a 'push' method to, when you push an instance of a different class, then you get the error: Can't call method "get_message" on unblessed reference rather than the expected type constraint validation failure message.
Subject: test.pl
use strict; use warnings; use Test::More; use Test::Exception; use Moose::Util::TypeConstraints; class_type 'Foo'; { package Moo; use Moose; } { package Bar; use Moose; has quux => ( is => 'ro', isa => 'ArrayRef[Foo]', traits => ['Array'], handles => { push_quux => 'push', }, ); } my $bar = Bar->new; $bar->push_quux(Moo->new); ok 1; done_testing;