summaryrefslogtreecommitdiff
path: root/lib/diagnostics.t
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2012-06-26 21:12:18 -0500
committerJesse Luehrs <doy@tozt.net>2012-06-28 03:06:08 -0500
commit67288365cab33e76a48b697c001c11d4dc5b1912 (patch)
tree8d612e9bb96382ad1b99581ae81e4f2a7356828b /lib/diagnostics.t
parent591097e07a9ddfd1783a99ea394ab7e4113242b3 (diff)
downloadperl-67288365cab33e76a48b697c001c11d4dc5b1912.tar.gz
propagate context into overloads [perl #47119]
amagic_call now does its best to propagate the operator's context into the overload callback. It's not always possible - for instance, dereferencing and stringify/boolify/numify always have to return a value, even if it's not used, due to the way the overload callback works in those cases - but the majority of cases should now work. In particular, overloading <> to handle list context properly is now possible. For backcompat reasons (amagic_call and friends are technically public api functions), list context will not be propagated unless specifically requested via the AMGf_want_list flag. If this is passed, and the operator is called in list context, amagic_call returns an AV* holding all of the returned values instead of an SV*. Void context always results in amagic_call returning &PL_sv_undef.
Diffstat (limited to 'lib/diagnostics.t')
0 files changed, 0 insertions, 0 deletions