perl seems to silently convert exceptions thrown in destructors into
warnings, in the category of "misc", so disabling misc warnings means
that exceptions in the destructor will be completely silent. confess
inside destructors seems to be completely silent regardless, which also
seems broken, but nothing we can really do about that. don't really want
to add tests for this, because it's really not clear what the intended
behavior is here.
(map { $inv . '->' . $_->{class} . '::DEMOLISH($igd);' } @methods),
'}',
'Try::Tiny::catch {',
- 'no warnings \'misc\';',
'die $_;',
'};',
);
$self->DEMOLISHALL(Devel::GlobalDestruction::in_global_destruction);
}
Try::Tiny::catch {
- # Without this, Perl will warn "\t(in cleanup)$@" because of some
- # bizarre fucked-up logic deep in the internals.
- no warnings 'misc';
die $_;
};