Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
treat when(index() > -1) as a boolean expression
RT #133368 when(X) is normally compiled as when($_ ~~ X) *except* when X appears to be a boolean expression, in which case it's used directly. 5.28.0 introduced an optimisation whereby comparisons involving index like index(...) != -1 eliminated the comparison, and pp_index() returned a boolean value directly. This defeated the 'look for a boolean op' mechanism, and so when(index(...) != -1) and similar were being incorrectly compiled as when($_ ~~ (index(...) != -1)) (cherry picked from commit 6b877bb)
- Loading branch information
Showing
2 changed files
with
29 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters