summaryrefslogtreecommitdiff
path: root/lib/overload.t
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2013-07-28 13:19:33 -0700
committerFather Chrysostomos <sprout@cpan.org>2013-07-28 13:19:33 -0700
commitba36554e02872e48d146177a57a9cfb154727fae (patch)
tree4b9877f12763e5fe851a174299b625a6c834fc65 /lib/overload.t
parentf99a5f08f203af84430e677e25df49557c55c24f (diff)
downloadperl-ba36554e02872e48d146177a57a9cfb154727fae.tar.gz
[perl #119043] Exempt shared hash key consts from ro
Commit 19130678b4 stopped copy-on-write scalars from being exempt from readonliness in ck_svconst (called for every OP_CONST). That was for the sake of consistency. It turns out this breaks CPAN modules, so change it back, but only for shared hash key scalars, not other COW scalars. This is an historical artefact left over from when copy-on-write used the read-only flag without the scalar actually being read-only.
Diffstat (limited to 'lib/overload.t')
-rw-r--r--lib/overload.t7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/overload.t b/lib/overload.t
index 3af969bc69..e9ceb50b1e 100644
--- a/lib/overload.t
+++ b/lib/overload.t
@@ -1293,16 +1293,15 @@ foreach my $op (qw(<=> == != < <= > >=)) {
}
{
- # Check readonliness of constants, whether shared hash key
- # scalars or no (brought up in bug #109744)
+ # Check readonliness of constants (brought up in bug #109744)
+ # For historical reasons, shared hash key scalars are exempt
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' };
- like $@, qr/^Modification of a read-only value attempted at /,
- '... even with shared hash key scalars';
+ is $@, "", 'except with shared hash key scalars';
}
{