my $Has_PH;
BEGIN {
$Has_PH = $] < 5.009;
}
my $W;
BEGIN {
$W = 0;
$W++;
}
else {
warn $_[0];
}
};
}
use strict;
use fields '_b1';
package M;
sub m {}
# Test that multiple inheritance fails.
package Foo::Bar;
package Foo::Bar::Baz;
use fields qw(foo bar baz);
# Test repeatability for when modules get reloaded.
package B1;
use fields qw(b1 b2 b3);
package D3;
use fields qw(b1 d1 _b1 _d1); # hide b1
# Test that a package with only private fields gets inherited properly
package B7;
use fields qw(_b1);
package D7;
use base qw(B7);
use fields qw(b1);
my %EXPECT = (
);
my %expected_fields;
$expected_fields{$key} = $idx;
}
}
# Did we get the appropriate amount of warnings?
# A simple object creation and attribute access test
# We should get compile time failures field name typos
like $@,
}
else {
like $@,
}
# Slices
# Break multiple inheritance with a field name clash.
eval {
# The error must occur at run time for the eval to catch it.
require base;
};
# Test that a package with no fields can inherit from a package with
{
my $w = 0;
# used tp emit a warning that pseudohashes are deprecated, because
# %FIELDS wasn't blessed.
}