Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the MooseX-MultiInitArg CPAN distribution.

Report information
The Basics
Id: 82560
Status: open
Priority: 0/
Queue: MooseX-MultiInitArg

People
Owner: Nobody in particular
Requestors: perl [...] toby.ink
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.01
Fixed in: (no value)



Subject: alternative init_args break when class is made immutable
Subject: multi-init-arg.t
use strict; use warnings; use Test::More; { package Foo; use Moose; use MooseX::MultiInitArg; has foo => ( is => 'ro', traits => ['MooseX::MultiInitArg::Trait'], init_args => [qw( fu )], ); # __PACKAGE__->meta->make_immutable; } sub check ($$) { my ($args, $name) = @_; is(Foo->new(@$args)->foo, 42, $name); } check [foo => 42], 'mutable class; standard init arg'; check [fu => 42], 'mutable class; alternative init arg'; Foo->meta->make_immutable; check [foo => 42], 'immutable class; standard init arg'; check [fu => 42], 'immutable class; alternative init arg'; done_testing;
I've published MooseX::CustomInitArgs which has a solution for this issue, plus supports some additional features.