summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2013-08-03 23:08:08 -0700
committerFather Chrysostomos <sprout@cpan.org>2013-08-03 23:08:08 -0700
commit9a0a8507578c570661730c652a2ff084dd3b9fe9 (patch)
tree780b7b36b089d2ec2667c7edde77d60f3cd53da2 /lib
parent1662bcf46eae814e0415d1f1a76383076f16d712 (diff)
downloadperl-9a0a8507578c570661730c652a2ff084dd3b9fe9.tar.gz
Revert "[perl #119043] Exempt shared hash key consts from ro"
This reverts commit ba36554e02872e48d146177a57a9cfb154727fae. It turns out it reinstates bugs like this: $ perl -e 'for(1..10){for(__PACKAGE__){warn $_; $_++}}' main at -e line 1. maio at -e line 1. maip at -e line 1. maiq at -e line 1. mair at -e line 1. mais at -e line 1. mait at -e line 1. maiu at -e line 1. maiv at -e line 1. maiw at -e line 1.
Diffstat (limited to 'lib')
-rw-r--r--lib/overload.t7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/overload.t b/lib/overload.t
index e9ceb50b1e..3af969bc69 100644
--- a/lib/overload.t
+++ b/lib/overload.t
@@ -1293,15 +1293,16 @@ foreach my $op (qw(<=> == != < <= > >=)) {
}
{
- # Check readonliness of constants (brought up in bug #109744)
- # For historical reasons, shared hash key scalars are exempt
+ # Check readonliness of constants, whether shared hash key
+ # scalars or no (brought up in bug #109744)
BEGIN { overload::constant integer => sub { "main" }; }
eval { ${\5} = 'whatever' };
like $@, qr/^Modification of a read-only value attempted at /,
'constant overloading makes read-only constants';
BEGIN { overload::constant integer => sub { __PACKAGE__ }; }
eval { ${\5} = 'whatever' };
- is $@, "", 'except with shared hash key scalars';
+ like $@, qr/^Modification of a read-only value attempted at /,
+ '... even with shared hash key scalars';
}
{