Skip Menu |

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

Report information
The Basics
Id: 27508
Status: rejected
Priority: 0/
Queue: Class-Trait

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

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



Subject: Why are DESTROY and AUTOLOAD disallowed?
I wrote the following trait: package CDBI::Trait::QuietDestruction; use strict; use warnings; use Class::Trait 'base'; our @REQUIRES = qw( discard_changes ); =head1 NAME CDBI::Trait::QuietDestruction - Quietly destroy CDBI objects with changes =head1 DESCRIPTION This trait changes Class::DBI such that it does not warn when an object containing unsaved changes is destroyed. =cut sub DESTROY { my $self = shift; $self->discard_changes; # Shuts up warnings } 1; Only to get "Error creating class for table cantatas: Trait CDBI::Trait::QuietDestruction attempted to implement disallowed method DESTROY". I don't see why DESTROY is disallowed, as shown above its useful to change the destructor behavior in a trait. Furthermore, there's no document of this fact. AUTOLOAD might have some weird conflict with Class::Trait::Base?
Rejected, sorry. As this module is deprecated, I'm hoping to have no more bug fixes after this. Cheers, Ovid