You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Previously: CORE::__CLASS__ and compile-time aliasing (as in `BEGIN {
*cls = \&CORE::__CLASS__; } ... cls`) worked as expected, but runtime
calls like `&CORE::__CLASS__()` and `my $ref = \&CORE::__CLASS__; ...
$ref->()` would produce bizarre results, behaving like CORE::__FILE__
instead.
Now the latter throw a "&CORE::__CLASS__ cannot be called directly"
error. This is perhaps not entirely satisfactory, but __CLASS__ is a bit
special (it is not a true constant and only usable in methods) and
erroring cleanly is better than silently returning wrong results.
Fixes#23737.
Assorted changes:
- Document core_prototype()'s `opnum` parameter.
- Add comment explaining what `*opnum = 0` means (and why it makes no
sense for KEY___CLASS__).
- Don't hardcode assumptions about keyword codes in coresub_op(). Handle
__PACKAGE__/__FILE__/__LINE__ explicitly and assert() nothing else is
passed in. This effectively reverts commit c2f605d.
- Remove CORE::__CLASS__ from op/coreamp.t as it is no longer "ampable".
- Extend op/coresubs.t to handle more of the idiosyncrasies of
CORE::__CLASS__.
0 commit comments