diff options
author | Jesse Luehrs <doy@tozt.net> | 2012-06-29 00:38:04 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2012-06-29 00:46:57 -0500 |
commit | 386a54892347d3298ba7f1e98f207e36bc4f3424 (patch) | |
tree | 9aa57403efdddc7d93295f6365c7e9a34142ba8f /gv.c | |
parent | af41786fe5732d5ec7932b946eec99a695ac6e43 (diff) | |
download | perl-386a54892347d3298ba7f1e98f207e36bc4f3424.tar.gz |
"use overload fallback => 0" should enable overloading [perl #113010]
This makes
package Foo;
use overload fallback => 0;
and
package Bar;
use overload '+' => \&add, fallback => 0;
behave identically when an operator other than '+' is used.
Diffstat (limited to 'gv.c')
-rw-r--r-- | gv.c | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -2274,10 +2274,16 @@ Perl_Gv_AMupdate(pTHX_ HV *stash, bool destructing) NOOP; /* Equivalent to !SvTRUE and !SvOK */ } #endif - else if (SvTRUE(sv)) + else if (SvTRUE(sv)) { amt.fallback=AMGfallYES; - else if (SvOK(sv)) + filled = 1; + have_ovl = 1; + } + else if (SvOK(sv)) { amt.fallback=AMGfallNEVER; + filled = 1; + have_ovl = 1; + } for (i = 1; i < lim; i++) amt.table[i] = NULL; |