mark CORE::__CLASS__ as non-ampable #23740
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Previously:
CORE::__CLASS__and compile-time aliasing (as inBEGIN { *cls = \&CORE::__CLASS__; } ... cls) worked as expected, but runtime calls like&CORE::__CLASS__()andmy $ref = \&CORE::__CLASS__; ... $ref->()would produce bizarre results, behaving likeCORE::__FILE__instead.Now the latter throw a
&CORE::__CLASS__ cannot be called directlyerror. 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.
Partially subsumes #23343.