summaryrefslogtreecommitdiff
path: root/lib/overload.t
diff options
context:
space:
mode:
Diffstat (limited to 'lib/overload.t')
-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';
}
{