Skip Menu |

This queue is for tickets about the Class-MOP CPAN distribution.

Report information
The Basics
Id: 46854
Status: resolved
Priority: 0/
Queue: Class-MOP

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

Bug Information
Severity: Important
Broken in: 0.85
Fixed in: 0.86



DESTROY is overridden by __PACKAGE__->meta->make_immutable. Test case attached -- also test case exists in Moose repository, as I originally thought this to be a Moose bug. It is a regression from previous versions. This bug was noticed in KiokuDB (KiokuDB::LiveObjects::Scope). Using DEMOLISH or not making the class immutable does cause kiokudb's test to pass.
Subject: fail.t
#!/usr/bin/perl use strict; use warnings; use Test::More tests => 1; BEGIN { package FooBar; use Moose; has 'name' => (is => 'ro'); sub DESTROY { shift->name } __PACKAGE__->meta->make_immutable; } my $f = FooBar->new(name => "SUSAN"); is($f->DESTROY, "SUSAN", "Did moose overload DESTROY?");
I believe I have fixed the bug in http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=gitmo/Class-MOP.git;a=commitdiff;h=d42eab150df35044732290db6ee810a35024c5d6;hp=10e77b62a925a7a177aed8769e62142ea5aa2df3 Class::MOP::Class::_inline_destructor() now gives a warning similar to _inline_constructor().