summaryrefslogtreecommitdiff
path: root/lib/overload.t
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2012-06-04 13:52:05 +0100
committerDavid Mitchell <davem@iabyn.com>2012-06-13 13:32:55 +0100
commit497d0a962eb278e5235610fab370cb59f4a5d7c4 (patch)
treea0b5234799a208523e151f56ff6c310c3218f46d /lib/overload.t
parente4bfbed39bdcbc5cd76c9cdfdeb3314c3710ad62 (diff)
downloadperl-497d0a962eb278e5235610fab370cb59f4a5d7c4.tar.gz
handle (??{}) returning an overloaded value
In this case, always pass the object to the regex compiler, which knows how handle this. (The diff looks more complex than it actually is: it just wraps the whole (logical == 2) branch with an 'if (!SvAMAGIC(ret))'.)
Diffstat (limited to 'lib/overload.t')
-rw-r--r--lib/overload.t7
1 files changed, 2 insertions, 5 deletions
diff --git a/lib/overload.t b/lib/overload.t
index 329b6c7e55..190dcf24f5 100644
--- a/lib/overload.t
+++ b/lib/overload.t
@@ -1208,11 +1208,8 @@ foreach my $op (qw(<=> == != < <= > >=)) {
my $qr = bless qr/y/, "QRonly";
ok("x" =~ $qr, "qr with qr-overload uses overload");
ok("y" !~ $qr, "qr with qr-overload uses overload");
- {
- local $::TODO = '?? fails with "qr with qr"' ;
- ok("x" =~ /^(??{$qr})$/, "qr with qr-overload with ?? uses overload");
- ok("y" !~ /^(??{$qr})$/, "qr with qr-overload with ?? uses overload");
- }
+ ok("x" =~ /^(??{$qr})$/, "qr with qr-overload with ?? uses overload");
+ ok("y" !~ /^(??{$qr})$/, "qr with qr-overload with ?? uses overload");
is("$qr", "".qr/y/, "qr with qr-overload stringify");
my $rx = $$qr;