From 9a0a8507578c570661730c652a2ff084dd3b9fe9 Mon Sep 17 00:00:00 2001 From: Father Chrysostomos Date: Sat, 3 Aug 2013 23:08:08 -0700 Subject: 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. --- lib/overload.t | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'lib') 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'; } { -- cgit v1.2.1