This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Optimization: Remove needless list/pushmark pairs from the OP execution
[perl5.git] / lib / overload.t
index e9ceb50..c83c0ed 100644 (file)
@@ -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';
 }
 
 {
@@ -2064,11 +2065,11 @@ fresh_perl_is
     }
 
     package NCmp;
-    use base 'CmpBase';
+    use parent '-norequire', 'CmpBase';
     use overload '<=>' => 'cmp';
 
     package SCmp;
-    use base 'CmpBase';
+    use parent '-norequire', 'CmpBase';
     use overload 'cmp' => 'cmp';
 
     package main;
@@ -2132,7 +2133,7 @@ fresh_perl_is
                 ? $nomethod . "=>'nomethod'," : '';
             eval qq{
                     package NuMB$fall$nomethod;
-                    use base qw/NuMB/;
+                    use parent '-norequire', qw/NuMB/;
                     use overload $nomethod_decl
                     fallback => $fall;
                 };