diff options
author | Jesse Luehrs <doy@tozt.net> | 2011-07-07 08:54:59 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2011-07-07 08:54:59 -0500 |
commit | 1172d8b556c93d35aff699eadfc10f93296d7319 (patch) | |
tree | e5e987da2974e3bea12b8e5f64fcbf032e8302ce /lib/smartmatch/engine | |
parent | 2c9613c69eded089c42a83d96a2f518d8f2eed83 (diff) | |
download | smartmatch-engine-core-1172d8b556c93d35aff699eadfc10f93296d7319.tar.gz smartmatch-engine-core-1172d8b556c93d35aff699eadfc10f93296d7319.zip |
reimplement the buggy behavior for now
Diffstat (limited to 'lib/smartmatch/engine')
-rw-r--r-- | lib/smartmatch/engine/core.pm | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/smartmatch/engine/core.pm b/lib/smartmatch/engine/core.pm index a3c96b9..e172b6c 100644 --- a/lib/smartmatch/engine/core.pm +++ b/lib/smartmatch/engine/core.pm @@ -55,6 +55,16 @@ sub match { } elsif (type($b) eq 'Object') { my $overload = overload::Method($b, '~~'); + + # XXX this is buggy behavior and may be changed + # see http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2011-07/msg00214.html + if (!$overload && overload::Overloaded($b)) { + $overload = overload::Method($a, '~~'); + die "no ~~ overloading on $b" + unless $overload; + return $a->$overload($b, 0); + } + die "no ~~ overloading on $b" unless $overload; return $b->$overload($a, 1); |