Now that mro_method_changed_in (triggered by the
‘*{$package . "::()"} = \&nil;’ assignment) causes overloadedness to
be checked the next time a overloaded operation occurs, it is not nec-
essary to trigger %OVERLOAD’s magic explicitly.
This also means that PL_amagic_generation is not incremented any more.
Unfortunately, we cannot eliminate it, as there are XS modules that
expect to increment it themselves to mark their caches as stale.
ok( $sg < B::sub_generation, "sub_generation increments" );
}
-{
- my $ag = B::amagic_generation();
- {
-
- package Whatever;
- require overload;
- overload->import( '""' => sub {"What? You want more?!"} );
- }
- ok( $ag < B::amagic_generation, "amagic_generation increments" );
-}
+like( B::amagic_generation, qr/^\d+\z/, "amagic_generation" );
is(B::svref_2object(sub {})->ROOT->ppaddr, 'PL_ppaddr[OP_LEAVESUB]',
'OP->ppaddr');
$package = shift;
my %arg = @_;
my ($sub, $fb);
- $ {$package . "::OVERLOAD"}{dummy}++; # Register with magic by touching.
*{$package . "::()"} = \&nil; # Make it findable via fetchmethod.
for (keys %arg) {
if ($_ eq 'fallback') {
sub unimport {
$package = (caller())[0];
- ${$package . "::OVERLOAD"}{dummy}++; # Upgrade the table
shift;
for (@_) {
delete $ {$package . "::"}{"(" . $_};