Skip Menu |

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

Report information
The Basics
Id: 67645
Status: open
Priority: 0/
Queue: MooseX-Singleton

People
Owner: Nobody in particular
Requestors: zwon [...] trinitum.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.26
Fixed in: (no value)



Subject: BUILD is not executed with Moose 2
If I make class immutable its BUILD method is not executed with Moose 2.0000. Attached test passes with Moose 1.25, but fails with Moose 2.0000. -- Pavel Shaydo
Subject: build_immutable.t
use Test::More qw(no_plan); { package Singleton; use MooseX::Singleton; has attribute => (is => 'rw'); sub BUILD { shift->attribute(1); } no Moose; __PACKAGE__->meta->make_immutable; } my $s = Singleton->instance; ok $s->attribute, "Attribute is set";
Please try this patch ;)
Subject: MooseX-Build.patch
diff -rc MooseX-Singleton-0.29/lib/MooseX/Singleton/Role/Meta/Class.pm MooseX-Singleton-0.29.patch/lib/MooseX/Singleton/Role/Meta/Class.pm *** MooseX-Singleton-0.29/lib/MooseX/Singleton/Role/Meta/Class.pm 2011-12-09 00:01:00.000000000 +0400 --- MooseX-Singleton-0.29.patch/lib/MooseX/Singleton/Role/Meta/Class.pm 2014-04-09 16:00:54.976917617 +0400 *************** *** 61,67 **** override _inline_extra_init => sub { my $self = shift; ! return '${$existing} = $instance;'; }; } --- 61,67 ---- override _inline_extra_init => sub { my $self = shift; ! return '${$existing} = $instance;', super(); }; }